@cartridge/controller-wasm 0.9.0 → 0.9.2

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,348 +1,5 @@
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
- function addHeapObject(obj) {
9
- if (heap_next === heap.length) heap.push(heap.length + 1);
10
- const idx = heap_next;
11
- heap_next = heap[idx];
12
-
13
- heap[idx] = obj;
14
- return idx;
15
- }
16
-
17
- function _assertClass(instance, klass) {
18
- if (!(instance instanceof klass)) {
19
- throw new Error(`expected instance of ${klass.name}`);
20
- }
21
- }
22
-
23
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
24
- ? { register: () => {}, unregister: () => {} }
25
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
26
-
27
- function debugString(val) {
28
- // primitive types
29
- const type = typeof val;
30
- if (type == 'number' || type == 'boolean' || val == null) {
31
- return `${val}`;
32
- }
33
- if (type == 'string') {
34
- return `"${val}"`;
35
- }
36
- if (type == 'symbol') {
37
- const description = val.description;
38
- if (description == null) {
39
- return 'Symbol';
40
- } else {
41
- return `Symbol(${description})`;
42
- }
43
- }
44
- if (type == 'function') {
45
- const name = val.name;
46
- if (typeof name == 'string' && name.length > 0) {
47
- return `Function(${name})`;
48
- } else {
49
- return 'Function';
50
- }
51
- }
52
- // objects
53
- if (Array.isArray(val)) {
54
- const length = val.length;
55
- let debug = '[';
56
- if (length > 0) {
57
- debug += debugString(val[0]);
58
- }
59
- for(let i = 1; i < length; i++) {
60
- debug += ', ' + debugString(val[i]);
61
- }
62
- debug += ']';
63
- return debug;
64
- }
65
- // Test for built-in
66
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
67
- let className;
68
- if (builtInMatches && builtInMatches.length > 1) {
69
- className = builtInMatches[1];
70
- } else {
71
- // Failed to match the standard '[object ClassName]'
72
- return toString.call(val);
73
- }
74
- if (className == 'Object') {
75
- // we're a user defined class or Object
76
- // JSON.stringify avoids problems with cycles, and is generally much
77
- // easier than looping through ownProperties of `val`.
78
- try {
79
- return 'Object(' + JSON.stringify(val) + ')';
80
- } catch (_) {
81
- return 'Object';
82
- }
83
- }
84
- // errors
85
- if (val instanceof Error) {
86
- return `${val.name}: ${val.message}\n${val.stack}`;
87
- }
88
- // TODO we could test for more things here, like `Set`s and `Map`s.
89
- return className;
90
- }
91
-
92
- function dropObject(idx) {
93
- if (idx < 132) return;
94
- heap[idx] = heap_next;
95
- heap_next = idx;
96
- }
97
-
98
- function getArrayJsValueFromWasm0(ptr, len) {
99
- ptr = ptr >>> 0;
100
- const mem = getDataViewMemory0();
101
- const result = [];
102
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
103
- result.push(takeObject(mem.getUint32(i, true)));
104
- }
105
- return result;
106
- }
107
-
108
- function getArrayU8FromWasm0(ptr, len) {
109
- ptr = ptr >>> 0;
110
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
111
- }
112
-
113
- let cachedDataViewMemory0 = null;
114
- function getDataViewMemory0() {
115
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
116
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
117
- }
118
- return cachedDataViewMemory0;
119
- }
120
-
121
- function getStringFromWasm0(ptr, len) {
122
- ptr = ptr >>> 0;
123
- return decodeText(ptr, len);
124
- }
125
-
126
- let cachedUint8ArrayMemory0 = null;
127
- function getUint8ArrayMemory0() {
128
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
129
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
130
- }
131
- return cachedUint8ArrayMemory0;
132
- }
133
-
134
- function getObject(idx) { return heap[idx]; }
135
-
136
- function handleError(f, args) {
137
- try {
138
- return f.apply(this, args);
139
- } catch (e) {
140
- wasm.__wbindgen_export3(addHeapObject(e));
141
- }
142
- }
143
-
144
- let heap = new Array(128).fill(undefined);
145
- heap.push(undefined, null, true, false);
146
-
147
- let heap_next = heap.length;
148
-
149
- function isLikeNone(x) {
150
- return x === undefined || x === null;
151
- }
152
-
153
- function makeClosure(arg0, arg1, dtor, f) {
154
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
155
- const real = (...args) => {
156
-
157
- // First up with a closure we increment the internal reference
158
- // count. This ensures that the Rust closure environment won't
159
- // be deallocated while we're invoking it.
160
- state.cnt++;
161
- try {
162
- return f(state.a, state.b, ...args);
163
- } finally {
164
- real._wbg_cb_unref();
165
- }
166
- };
167
- real._wbg_cb_unref = () => {
168
- if (--state.cnt === 0) {
169
- state.dtor(state.a, state.b);
170
- state.a = 0;
171
- CLOSURE_DTORS.unregister(state);
172
- }
173
- };
174
- CLOSURE_DTORS.register(real, state, state);
175
- return real;
176
- }
177
-
178
- function makeMutClosure(arg0, arg1, dtor, f) {
179
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
180
- const real = (...args) => {
181
-
182
- // First up with a closure we increment the internal reference
183
- // count. This ensures that the Rust closure environment won't
184
- // be deallocated while we're invoking it.
185
- state.cnt++;
186
- const a = state.a;
187
- state.a = 0;
188
- try {
189
- return f(a, state.b, ...args);
190
- } finally {
191
- state.a = a;
192
- real._wbg_cb_unref();
193
- }
194
- };
195
- real._wbg_cb_unref = () => {
196
- if (--state.cnt === 0) {
197
- state.dtor(state.a, state.b);
198
- state.a = 0;
199
- CLOSURE_DTORS.unregister(state);
200
- }
201
- };
202
- CLOSURE_DTORS.register(real, state, state);
203
- return real;
204
- }
205
-
206
- function passArrayJsValueToWasm0(array, malloc) {
207
- const ptr = malloc(array.length * 4, 4) >>> 0;
208
- const mem = getDataViewMemory0();
209
- for (let i = 0; i < array.length; i++) {
210
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
211
- }
212
- WASM_VECTOR_LEN = array.length;
213
- return ptr;
214
- }
215
-
216
- function passStringToWasm0(arg, malloc, realloc) {
217
- if (realloc === undefined) {
218
- const buf = cachedTextEncoder.encode(arg);
219
- const ptr = malloc(buf.length, 1) >>> 0;
220
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
221
- WASM_VECTOR_LEN = buf.length;
222
- return ptr;
223
- }
224
-
225
- let len = arg.length;
226
- let ptr = malloc(len, 1) >>> 0;
227
-
228
- const mem = getUint8ArrayMemory0();
229
-
230
- let offset = 0;
231
-
232
- for (; offset < len; offset++) {
233
- const code = arg.charCodeAt(offset);
234
- if (code > 0x7F) break;
235
- mem[ptr + offset] = code;
236
- }
237
- if (offset !== len) {
238
- if (offset !== 0) {
239
- arg = arg.slice(offset);
240
- }
241
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
242
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
243
- const ret = cachedTextEncoder.encodeInto(arg, view);
244
-
245
- offset += ret.written;
246
- ptr = realloc(ptr, len, offset, 1) >>> 0;
247
- }
248
-
249
- WASM_VECTOR_LEN = offset;
250
- return ptr;
251
- }
252
-
253
- function takeObject(idx) {
254
- const ret = getObject(idx);
255
- dropObject(idx);
256
- return ret;
257
- }
258
-
259
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
260
- cachedTextDecoder.decode();
261
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
262
- let numBytesDecoded = 0;
263
- function decodeText(ptr, len) {
264
- numBytesDecoded += len;
265
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
266
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
267
- cachedTextDecoder.decode();
268
- numBytesDecoded = len;
269
- }
270
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
271
- }
272
-
273
- const cachedTextEncoder = new TextEncoder();
274
-
275
- if (!('encodeInto' in cachedTextEncoder)) {
276
- cachedTextEncoder.encodeInto = function (arg, view) {
277
- const buf = cachedTextEncoder.encode(arg);
278
- view.set(buf);
279
- return {
280
- read: arg.length,
281
- written: buf.length
282
- };
283
- }
284
- }
285
-
286
- let WASM_VECTOR_LEN = 0;
287
-
288
- function __wasm_bindgen_func_elem_8776(arg0, arg1, arg2) {
289
- wasm.__wasm_bindgen_func_elem_8776(arg0, arg1, addHeapObject(arg2));
290
- }
291
-
292
- function __wasm_bindgen_func_elem_8626(arg0, arg1) {
293
- wasm.__wasm_bindgen_func_elem_8626(arg0, arg1);
294
- }
295
-
296
- function __wasm_bindgen_func_elem_3270(arg0, arg1, arg2) {
297
- wasm.__wasm_bindgen_func_elem_3270(arg0, arg1, addHeapObject(arg2));
298
- }
299
-
300
- function __wasm_bindgen_func_elem_10873(arg0, arg1, arg2, arg3) {
301
- wasm.__wasm_bindgen_func_elem_10873(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
302
- }
303
-
304
- const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
305
-
306
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
307
-
308
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
309
-
310
- const CartridgeAccountFinalization = (typeof FinalizationRegistry === 'undefined')
311
- ? { register: () => {}, unregister: () => {} }
312
- : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccount_free(ptr >>> 0, 1));
313
-
314
- const CartridgeAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
315
- ? { register: () => {}, unregister: () => {} }
316
- : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountmeta_free(ptr >>> 0, 1));
317
-
318
- const CartridgeAccountWithMetaFinalization = (typeof FinalizationRegistry === 'undefined')
319
- ? { register: () => {}, unregister: () => {} }
320
- : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountwithmeta_free(ptr >>> 0, 1));
321
-
322
- const ControllerFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
323
- ? { register: () => {}, unregister: () => {} }
324
- : new FinalizationRegistry(ptr => wasm.__wbg_controllerfactory_free(ptr >>> 0, 1));
325
-
326
- const JsChainConfigFinalization = (typeof FinalizationRegistry === 'undefined')
327
- ? { register: () => {}, unregister: () => {} }
328
- : new FinalizationRegistry(ptr => wasm.__wbg_jschainconfig_free(ptr >>> 0, 1));
329
-
330
- const JsControllerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
331
- ? { register: () => {}, unregister: () => {} }
332
- : new FinalizationRegistry(ptr => wasm.__wbg_jscontrollererror_free(ptr >>> 0, 1));
333
-
334
- const LoginResultFinalization = (typeof FinalizationRegistry === 'undefined')
335
- ? { register: () => {}, unregister: () => {} }
336
- : new FinalizationRegistry(ptr => wasm.__wbg_loginresult_free(ptr >>> 0, 1));
337
-
338
- const MultiChainAccountFinalization = (typeof FinalizationRegistry === 'undefined')
339
- ? { register: () => {}, unregister: () => {} }
340
- : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccount_free(ptr >>> 0, 1));
341
-
342
- const MultiChainAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
343
- ? { register: () => {}, unregister: () => {} }
344
- : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccountmeta_free(ptr >>> 0, 1));
345
-
346
3
  export class CartridgeAccount {
347
4
  static __wrap(ptr) {
348
5
  ptr = ptr >>> 0;
@@ -362,172 +19,166 @@ export class CartridgeAccount {
362
19
  wasm.__wbg_cartridgeaccount_free(ptr, 0);
363
20
  }
364
21
  /**
22
+ * @param {Signer | null} [owner]
23
+ * @param {JsAddSignerInput | null} [signer_input]
24
+ * @param {string | null} [rp_id]
365
25
  * @returns {Promise<void>}
366
26
  */
367
- disconnect() {
368
- const ret = wasm.cartridgeaccount_disconnect(this.__wbg_ptr);
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);
369
31
  return takeObject(ret);
370
32
  }
371
33
  /**
372
- * @param {JsFeeEstimate | null} [max_fee]
373
- * @returns {Promise<any>}
34
+ * @param {string} rp_id
35
+ * @returns {Promise<JsAddSignerInput>}
374
36
  */
375
- deploySelf(max_fee) {
376
- const ret = wasm.cartridgeaccount_deploySelf(this.__wbg_ptr, isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
37
+ createPasskeySigner(rp_id) {
38
+ const ptr0 = passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
39
+ const len0 = WASM_VECTOR_LEN;
40
+ const ret = wasm.cartridgeaccount_createPasskeySigner(this.__wbg_ptr, ptr0, len0);
377
41
  return takeObject(ret);
378
42
  }
379
43
  /**
380
- * @param {string} cartridge_api_url
381
- * @returns {Promise<CartridgeAccountWithMeta | undefined>}
44
+ * @param {string} app_id
45
+ * @param {Policy[]} policies
46
+ * @param {bigint} expires_at
47
+ * @param {boolean | null} [authorize_user_execution]
48
+ * @returns {Promise<AuthorizedSession | undefined>}
382
49
  */
383
- static fromStorage(cartridge_api_url) {
384
- const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
50
+ createSession(app_id, policies, expires_at, authorize_user_execution) {
51
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
385
52
  const len0 = WASM_VECTOR_LEN;
386
- const ret = wasm.cartridgeaccount_fromStorage(ptr0, len0);
53
+ const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
54
+ const len1 = WASM_VECTOR_LEN;
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);
387
56
  return takeObject(ret);
388
57
  }
389
58
  /**
390
- * Creates a new `CartridgeAccount` instance with a randomly generated Starknet signer.
391
- * The controller address is computed internally based on the generated signer.
392
- *
393
- * # Parameters
394
- * - `rpc_url`: The URL of the JSON-RPC endpoint.
395
- * - `username`: Username associated with the account.
396
- * @param {JsFelt} class_hash
397
- * @param {string} rpc_url
398
- * @param {string} username
399
- * @param {string} cartridge_api_url
400
- * @returns {Promise<CartridgeAccountWithMeta>}
59
+ * @returns {Promise<JsFelt>}
401
60
  */
402
- static newHeadless(class_hash, rpc_url, username, cartridge_api_url) {
403
- const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
404
- const len0 = WASM_VECTOR_LEN;
405
- const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
406
- const len1 = WASM_VECTOR_LEN;
407
- const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
408
- const len2 = WASM_VECTOR_LEN;
409
- const ret = wasm.cartridgeaccount_newHeadless(addHeapObject(class_hash), ptr0, len0, ptr1, len1, ptr2, len2);
61
+ delegateAccount() {
62
+ const ret = wasm.cartridgeaccount_delegateAccount(this.__wbg_ptr);
410
63
  return takeObject(ret);
411
64
  }
412
65
  /**
413
- * @param {JsRemoveSignerInput} signer
414
- * @returns {Promise<void>}
66
+ * @param {JsFeeEstimate | null} [max_fee]
67
+ * @returns {Promise<any>}
415
68
  */
416
- removeOwner(signer) {
417
- 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));
418
71
  return takeObject(ret);
419
72
  }
420
73
  /**
421
- * @param {string} typed_data
422
- * @returns {Promise<Felts>}
74
+ * @returns {Promise<void>}
423
75
  */
424
- signMessage(typed_data) {
425
- const ptr0 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
426
- const len0 = WASM_VECTOR_LEN;
427
- const ret = wasm.cartridgeaccount_signMessage(this.__wbg_ptr, ptr0, len0);
76
+ disconnect() {
77
+ const ret = wasm.cartridgeaccount_disconnect(this.__wbg_ptr);
428
78
  return takeObject(ret);
429
79
  }
430
80
  /**
431
- * @param {string} app_id
432
- * @param {Policy[]} policies
433
- * @returns {Promise<void>}
81
+ * @param {JsCall[]} calls
82
+ * @returns {Promise<JsFeeEstimate>}
434
83
  */
435
- skipSession(app_id, policies) {
436
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
84
+ estimateInvokeFee(calls) {
85
+ const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
437
86
  const len0 = WASM_VECTOR_LEN;
438
- const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
439
- const len1 = WASM_VECTOR_LEN;
440
- const ret = wasm.cartridgeaccount_skipSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
87
+ const ret = wasm.cartridgeaccount_estimateInvokeFee(this.__wbg_ptr, ptr0, len0);
441
88
  return takeObject(ret);
442
89
  }
443
90
  /**
444
- * @param {string} app_id
445
- * @param {Policy[]} policies
446
- * @param {bigint} expires_at
447
- * @param {boolean | null} [authorize_user_execution]
448
- * @returns {Promise<AuthorizedSession | undefined>}
91
+ * @param {JsCall[]} calls
92
+ * @param {JsFeeEstimate | null} [max_fee]
93
+ * @param {JsFeeSource | null} [fee_source]
94
+ * @returns {Promise<any>}
449
95
  */
450
- createSession(app_id, policies, expires_at, authorize_user_execution) {
451
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
96
+ execute(calls, max_fee, fee_source) {
97
+ const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
452
98
  const len0 = WASM_VECTOR_LEN;
453
- const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
454
- const len1 = WASM_VECTOR_LEN;
455
- const ret = wasm.cartridgeaccount_createSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, isLikeNone(authorize_user_execution) ? 0xFFFFFF : authorize_user_execution ? 1 : 0);
99
+ const ret = wasm.cartridgeaccount_execute(this.__wbg_ptr, ptr0, len0, isLikeNone(max_fee) ? 0 : addHeapObject(max_fee), isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
456
100
  return takeObject(ret);
457
101
  }
458
102
  /**
459
- * @param {JsRevokableSession} session
460
- * @returns {Promise<void>}
103
+ * @param {JsCall[]} calls
104
+ * @param {JsFeeSource | null} [fee_source]
105
+ * @returns {Promise<any>}
461
106
  */
462
- revokeSession(session) {
463
- const ret = wasm.cartridgeaccount_revokeSession(this.__wbg_ptr, addHeapObject(session));
107
+ executeFromOutsideV2(calls, fee_source) {
108
+ const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
109
+ const len0 = WASM_VECTOR_LEN;
110
+ const ret = wasm.cartridgeaccount_executeFromOutsideV2(this.__wbg_ptr, ptr0, len0, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
464
111
  return takeObject(ret);
465
112
  }
466
113
  /**
467
- * @param {JsRevokableSession[]} sessions
468
- * @returns {Promise<void>}
114
+ * @param {JsCall[]} calls
115
+ * @param {JsFeeSource | null} [fee_source]
116
+ * @returns {Promise<any>}
469
117
  */
470
- revokeSessions(sessions) {
471
- const ptr0 = passArrayJsValueToWasm0(sessions, wasm.__wbindgen_export);
118
+ executeFromOutsideV3(calls, fee_source) {
119
+ const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
472
120
  const len0 = WASM_VECTOR_LEN;
473
- const ret = wasm.cartridgeaccount_revokeSessions(this.__wbg_ptr, ptr0, len0);
121
+ const ret = wasm.cartridgeaccount_executeFromOutsideV3(this.__wbg_ptr, ptr0, len0, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
474
122
  return takeObject(ret);
475
123
  }
476
124
  /**
477
- * @returns {Promise<JsFelt>}
125
+ * @param {string} cartridge_api_url
126
+ * @returns {Promise<CartridgeAccountWithMeta | undefined>}
478
127
  */
479
- delegateAccount() {
480
- const ret = wasm.cartridgeaccount_delegateAccount(this.__wbg_ptr);
128
+ static fromStorage(cartridge_api_url) {
129
+ const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
130
+ const len0 = WASM_VECTOR_LEN;
131
+ const ret = wasm.cartridgeaccount_fromStorage(ptr0, len0);
481
132
  return takeObject(ret);
482
133
  }
483
134
  /**
484
- * @param {string} app_id
485
- * @param {Policy[]} policies
486
- * @param {bigint} expires_at
487
- * @param {JsFelt} public_key
488
- * @param {JsFeeEstimate | null} [max_fee]
489
135
  * @returns {Promise<any>}
490
136
  */
491
- registerSession(app_id, policies, expires_at, public_key, max_fee) {
492
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
493
- const len0 = WASM_VECTOR_LEN;
494
- const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
495
- const len1 = WASM_VECTOR_LEN;
496
- const ret = wasm.cartridgeaccount_registerSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, addHeapObject(public_key), isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
137
+ getNonce() {
138
+ const ret = wasm.cartridgeaccount_getNonce(this.__wbg_ptr);
497
139
  return takeObject(ret);
498
140
  }
499
141
  /**
142
+ * @param {string} app_id
500
143
  * @param {JsCall[]} calls
501
- * @returns {Promise<JsFeeEstimate>}
144
+ * @returns {Promise<boolean>}
502
145
  */
503
- estimateInvokeFee(calls) {
504
- const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
146
+ hasAuthorizedPoliciesForCalls(app_id, calls) {
147
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
505
148
  const len0 = WASM_VECTOR_LEN;
506
- const ret = wasm.cartridgeaccount_estimateInvokeFee(this.__wbg_ptr, ptr0, len0);
149
+ const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
150
+ const len1 = WASM_VECTOR_LEN;
151
+ const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForCalls(this.__wbg_ptr, ptr0, len0, ptr1, len1);
507
152
  return takeObject(ret);
508
153
  }
509
154
  /**
510
155
  * @param {string} app_id
511
- * @param {JsCall[]} calls
512
- * @param {JsFeeSource | null} [fee_source]
513
- * @returns {Promise<any>}
156
+ * @param {string} typed_data
157
+ * @returns {Promise<boolean>}
514
158
  */
515
- trySessionExecute(app_id, calls, fee_source) {
159
+ hasAuthorizedPoliciesForMessage(app_id, typed_data) {
516
160
  const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
517
161
  const len0 = WASM_VECTOR_LEN;
518
- const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
162
+ const ptr1 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
519
163
  const len1 = WASM_VECTOR_LEN;
520
- const ret = wasm.cartridgeaccount_trySessionExecute(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
164
+ const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForMessage(this.__wbg_ptr, ptr0, len0, ptr1, len1);
521
165
  return takeObject(ret);
522
166
  }
523
167
  /**
524
- * @param {string} rp_id
525
- * @returns {Promise<JsAddSignerInput>}
168
+ * Checks if there are stored policies for a given app_id.
169
+ *
170
+ * # Parameters
171
+ * - `app_id`: The application identifier to check for stored policies
172
+ *
173
+ * # Returns
174
+ * `true` if policies exist for the given app_id, `false` otherwise
175
+ * @param {string} app_id
176
+ * @returns {Promise<boolean>}
526
177
  */
527
- createPasskeySigner(rp_id) {
528
- const ptr0 = passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
178
+ hasPoliciesForAppId(app_id) {
179
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
529
180
  const len0 = WASM_VECTOR_LEN;
530
- const ret = wasm.cartridgeaccount_createPasskeySigner(this.__wbg_ptr, ptr0, len0);
181
+ const ret = wasm.cartridgeaccount_hasPoliciesForAppId(this.__wbg_ptr, ptr0, len0);
531
182
  return takeObject(ret);
532
183
  }
533
184
  /**
@@ -544,42 +195,87 @@ export class CartridgeAccount {
544
195
  return takeObject(ret);
545
196
  }
546
197
  /**
547
- * @param {JsCall[]} calls
548
- * @param {JsFeeSource | null} [fee_source]
549
- * @returns {Promise<any>}
198
+ * @param {Policy[]} policies
199
+ * @param {JsFelt | null} [public_key]
200
+ * @returns {Promise<AuthorizedSession | undefined>}
550
201
  */
551
- executeFromOutsideV2(calls, fee_source) {
552
- const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
202
+ isRegisteredSessionAuthorized(policies, public_key) {
203
+ const ptr0 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
553
204
  const len0 = WASM_VECTOR_LEN;
554
- const ret = wasm.cartridgeaccount_executeFromOutsideV2(this.__wbg_ptr, ptr0, len0, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
205
+ const ret = wasm.cartridgeaccount_isRegisteredSessionAuthorized(this.__wbg_ptr, ptr0, len0, isLikeNone(public_key) ? 0 : addHeapObject(public_key));
555
206
  return takeObject(ret);
556
207
  }
557
208
  /**
558
- * @param {JsCall[]} calls
559
- * @param {JsFeeSource | null} [fee_source]
560
- * @returns {Promise<any>}
209
+ * Creates a new `CartridgeAccount` instance.
210
+ *
211
+ * # Parameters
212
+ * - `rpc_url`: The URL of the JSON-RPC endpoint.
213
+ * - `address`: The blockchain address associated with the account.
214
+ * - `username`: Username associated with the account.
215
+ * - `owner`: A Owner struct containing the owner signer and associated data.
216
+ * @param {JsFelt} class_hash
217
+ * @param {string} rpc_url
218
+ * @param {JsFelt} address
219
+ * @param {string} username
220
+ * @param {Owner} owner
221
+ * @param {string} cartridge_api_url
222
+ * @returns {Promise<CartridgeAccountWithMeta>}
561
223
  */
562
- executeFromOutsideV3(calls, fee_source) {
563
- const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
224
+ static new(class_hash, rpc_url, address, username, owner, cartridge_api_url) {
225
+ const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
564
226
  const len0 = WASM_VECTOR_LEN;
565
- const ret = wasm.cartridgeaccount_executeFromOutsideV3(this.__wbg_ptr, ptr0, len0, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
227
+ const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
228
+ const len1 = WASM_VECTOR_LEN;
229
+ const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
230
+ const len2 = WASM_VECTOR_LEN;
231
+ const ret = wasm.cartridgeaccount_new(addHeapObject(class_hash), ptr0, len0, addHeapObject(address), ptr1, len1, addHeapObject(owner), ptr2, len2);
566
232
  return takeObject(ret);
567
233
  }
568
234
  /**
569
- * Checks if there are stored policies for a given app_id.
235
+ * Creates a new `CartridgeAccount` instance with a randomly generated Starknet signer.
236
+ * The controller address is computed internally based on the generated signer.
570
237
  *
571
238
  * # Parameters
572
- * - `app_id`: The application identifier to check for stored policies
573
- *
574
- * # Returns
575
- * `true` if policies exist for the given app_id, `false` otherwise
239
+ * - `rpc_url`: The URL of the JSON-RPC endpoint.
240
+ * - `username`: Username associated with the account.
241
+ * @param {JsFelt} class_hash
242
+ * @param {string} rpc_url
243
+ * @param {string} username
244
+ * @param {string} cartridge_api_url
245
+ * @returns {Promise<CartridgeAccountWithMeta>}
246
+ */
247
+ static newHeadless(class_hash, rpc_url, username, cartridge_api_url) {
248
+ const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
249
+ const len0 = WASM_VECTOR_LEN;
250
+ const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
251
+ const len1 = WASM_VECTOR_LEN;
252
+ const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
253
+ const len2 = WASM_VECTOR_LEN;
254
+ const ret = wasm.cartridgeaccount_newHeadless(addHeapObject(class_hash), ptr0, len0, ptr1, len1, ptr2, len2);
255
+ return takeObject(ret);
256
+ }
257
+ /**
258
+ * @param {JsRegister} register
259
+ * @returns {Promise<JsRegisterResponse>}
260
+ */
261
+ register(register) {
262
+ const ret = wasm.cartridgeaccount_register(this.__wbg_ptr, addHeapObject(register));
263
+ return takeObject(ret);
264
+ }
265
+ /**
576
266
  * @param {string} app_id
577
- * @returns {Promise<boolean>}
267
+ * @param {Policy[]} policies
268
+ * @param {bigint} expires_at
269
+ * @param {JsFelt} public_key
270
+ * @param {JsFeeEstimate | null} [max_fee]
271
+ * @returns {Promise<any>}
578
272
  */
579
- hasPoliciesForAppId(app_id) {
273
+ registerSession(app_id, policies, expires_at, public_key, max_fee) {
580
274
  const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
581
275
  const len0 = WASM_VECTOR_LEN;
582
- const ret = wasm.cartridgeaccount_hasPoliciesForAppId(this.__wbg_ptr, ptr0, len0);
276
+ const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
277
+ const len1 = WASM_VECTOR_LEN;
278
+ const ret = wasm.cartridgeaccount_registerSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, addHeapObject(public_key), isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
583
279
  return takeObject(ret);
584
280
  }
585
281
  /**
@@ -594,6 +290,32 @@ export class CartridgeAccount {
594
290
  const ret = wasm.cartridgeaccount_registerSessionCalldata(this.__wbg_ptr, ptr0, len0, expires_at, addHeapObject(public_key));
595
291
  return takeObject(ret);
596
292
  }
293
+ /**
294
+ * @param {JsRemoveSignerInput} signer
295
+ * @returns {Promise<void>}
296
+ */
297
+ removeOwner(signer) {
298
+ const ret = wasm.cartridgeaccount_removeOwner(this.__wbg_ptr, addHeapObject(signer));
299
+ return takeObject(ret);
300
+ }
301
+ /**
302
+ * @param {JsRevokableSession} session
303
+ * @returns {Promise<void>}
304
+ */
305
+ revokeSession(session) {
306
+ const ret = wasm.cartridgeaccount_revokeSession(this.__wbg_ptr, addHeapObject(session));
307
+ return takeObject(ret);
308
+ }
309
+ /**
310
+ * @param {JsRevokableSession[]} sessions
311
+ * @returns {Promise<void>}
312
+ */
313
+ revokeSessions(sessions) {
314
+ const ptr0 = passArrayJsValueToWasm0(sessions, wasm.__wbindgen_export);
315
+ const len0 = WASM_VECTOR_LEN;
316
+ const ret = wasm.cartridgeaccount_revokeSessions(this.__wbg_ptr, ptr0, len0);
317
+ return takeObject(ret);
318
+ }
597
319
  /**
598
320
  * Signs an OutsideExecution V3 transaction and returns both the OutsideExecution object and its signature.
599
321
  *
@@ -612,78 +334,40 @@ export class CartridgeAccount {
612
334
  return takeObject(ret);
613
335
  }
614
336
  /**
615
- * @param {Policy[]} policies
616
- * @param {JsFelt | null} [public_key]
617
- * @returns {Promise<AuthorizedSession | undefined>}
618
- */
619
- isRegisteredSessionAuthorized(policies, public_key) {
620
- const ptr0 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
621
- const len0 = WASM_VECTOR_LEN;
622
- const ret = wasm.cartridgeaccount_isRegisteredSessionAuthorized(this.__wbg_ptr, ptr0, len0, isLikeNone(public_key) ? 0 : addHeapObject(public_key));
623
- return takeObject(ret);
624
- }
625
- /**
626
- * @param {string} app_id
627
- * @param {JsCall[]} calls
628
- * @returns {Promise<boolean>}
629
- */
630
- hasAuthorizedPoliciesForCalls(app_id, calls) {
631
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
632
- const len0 = WASM_VECTOR_LEN;
633
- const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
634
- const len1 = WASM_VECTOR_LEN;
635
- const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForCalls(this.__wbg_ptr, ptr0, len0, ptr1, len1);
636
- return takeObject(ret);
637
- }
638
- /**
639
- * @param {string} app_id
640
337
  * @param {string} typed_data
641
- * @returns {Promise<boolean>}
338
+ * @returns {Promise<Felts>}
642
339
  */
643
- hasAuthorizedPoliciesForMessage(app_id, typed_data) {
644
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
340
+ signMessage(typed_data) {
341
+ const ptr0 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
645
342
  const len0 = WASM_VECTOR_LEN;
646
- const ptr1 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
647
- const len1 = WASM_VECTOR_LEN;
648
- const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForMessage(this.__wbg_ptr, ptr0, len0, ptr1, len1);
343
+ const ret = wasm.cartridgeaccount_signMessage(this.__wbg_ptr, ptr0, len0);
649
344
  return takeObject(ret);
650
345
  }
651
346
  /**
652
- * Creates a new `CartridgeAccount` instance.
653
- *
654
- * # Parameters
655
- * - `rpc_url`: The URL of the JSON-RPC endpoint.
656
- * - `address`: The blockchain address associated with the account.
657
- * - `username`: Username associated with the account.
658
- * - `owner`: A Owner struct containing the owner signer and associated data.
659
- * @param {JsFelt} class_hash
660
- * @param {string} rpc_url
661
- * @param {JsFelt} address
662
- * @param {string} username
663
- * @param {Owner} owner
664
- * @param {string} cartridge_api_url
665
- * @returns {Promise<CartridgeAccountWithMeta>}
347
+ * @param {string} app_id
348
+ * @param {Policy[]} policies
349
+ * @returns {Promise<void>}
666
350
  */
667
- static new(class_hash, rpc_url, address, username, owner, cartridge_api_url) {
668
- const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
351
+ skipSession(app_id, policies) {
352
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
669
353
  const len0 = WASM_VECTOR_LEN;
670
- const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
354
+ const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
671
355
  const len1 = WASM_VECTOR_LEN;
672
- const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
673
- const len2 = WASM_VECTOR_LEN;
674
- const ret = wasm.cartridgeaccount_new(addHeapObject(class_hash), ptr0, len0, addHeapObject(address), ptr1, len1, addHeapObject(owner), ptr2, len2);
356
+ const ret = wasm.cartridgeaccount_skipSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
675
357
  return takeObject(ret);
676
358
  }
677
359
  /**
360
+ * @param {string} app_id
678
361
  * @param {JsCall[]} calls
679
- * @param {JsFeeEstimate | null} [max_fee]
680
362
  * @param {JsFeeSource | null} [fee_source]
681
363
  * @returns {Promise<any>}
682
364
  */
683
- execute(calls, max_fee, fee_source) {
684
- const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
365
+ trySessionExecute(app_id, calls, fee_source) {
366
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
685
367
  const len0 = WASM_VECTOR_LEN;
686
- const ret = wasm.cartridgeaccount_execute(this.__wbg_ptr, ptr0, len0, isLikeNone(max_fee) ? 0 : addHeapObject(max_fee), isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
368
+ const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
369
+ const len1 = WASM_VECTOR_LEN;
370
+ const ret = wasm.cartridgeaccount_trySessionExecute(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
687
371
  return takeObject(ret);
688
372
  }
689
373
  /**
@@ -694,33 +378,6 @@ export class CartridgeAccount {
694
378
  const ret = wasm.cartridgeaccount_upgrade(this.__wbg_ptr, addHeapObject(new_class_hash));
695
379
  return takeObject(ret);
696
380
  }
697
- /**
698
- * @param {JsRegister} register
699
- * @returns {Promise<JsRegisterResponse>}
700
- */
701
- register(register) {
702
- const ret = wasm.cartridgeaccount_register(this.__wbg_ptr, addHeapObject(register));
703
- return takeObject(ret);
704
- }
705
- /**
706
- * @param {Signer | null} [owner]
707
- * @param {JsAddSignerInput | null} [signer_input]
708
- * @param {string | null} [rp_id]
709
- * @returns {Promise<void>}
710
- */
711
- addOwner(owner, signer_input, rp_id) {
712
- var ptr0 = isLikeNone(rp_id) ? 0 : passStringToWasm0(rp_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
713
- var len0 = WASM_VECTOR_LEN;
714
- const ret = wasm.cartridgeaccount_addOwner(this.__wbg_ptr, isLikeNone(owner) ? 0 : addHeapObject(owner), isLikeNone(signer_input) ? 0 : addHeapObject(signer_input), ptr0, len0);
715
- return takeObject(ret);
716
- }
717
- /**
718
- * @returns {Promise<any>}
719
- */
720
- getNonce() {
721
- const ret = wasm.cartridgeaccount_getNonce(this.__wbg_ptr);
722
- return takeObject(ret);
723
- }
724
381
  }
725
382
  if (Symbol.dispose) CartridgeAccount.prototype[Symbol.dispose] = CartridgeAccount.prototype.free;
726
383
 
@@ -758,12 +415,12 @@ export class CartridgeAccountMeta {
758
415
  /**
759
416
  * @returns {string}
760
417
  */
761
- classHash() {
418
+ address() {
762
419
  let deferred1_0;
763
420
  let deferred1_1;
764
421
  try {
765
422
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
766
- wasm.cartridgeaccountmeta_classHash(retptr, this.__wbg_ptr);
423
+ wasm.cartridgeaccountmeta_address(retptr, this.__wbg_ptr);
767
424
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
768
425
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
769
426
  deferred1_0 = r0;
@@ -774,29 +431,15 @@ export class CartridgeAccountMeta {
774
431
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
775
432
  }
776
433
  }
777
- /**
778
- * @returns {JsFelt}
779
- */
780
- ownerGuid() {
781
- const ret = wasm.cartridgeaccountmeta_ownerGuid(this.__wbg_ptr);
782
- return takeObject(ret);
783
- }
784
- /**
785
- * @returns {Owner}
786
- */
787
- owner() {
788
- const ret = wasm.cartridgeaccountmeta_owner(this.__wbg_ptr);
789
- return takeObject(ret);
790
- }
791
434
  /**
792
435
  * @returns {string}
793
436
  */
794
- address() {
437
+ chainId() {
795
438
  let deferred1_0;
796
439
  let deferred1_1;
797
440
  try {
798
441
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
799
- wasm.cartridgeaccountmeta_address(retptr, this.__wbg_ptr);
442
+ wasm.cartridgeaccountmeta_chainId(retptr, this.__wbg_ptr);
800
443
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
801
444
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
802
445
  deferred1_0 = r0;
@@ -810,12 +453,12 @@ export class CartridgeAccountMeta {
810
453
  /**
811
454
  * @returns {string}
812
455
  */
813
- rpcUrl() {
456
+ classHash() {
814
457
  let deferred1_0;
815
458
  let deferred1_1;
816
459
  try {
817
460
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
818
- wasm.cartridgeaccountmeta_rpcUrl(retptr, this.__wbg_ptr);
461
+ wasm.cartridgeaccountmeta_classHash(retptr, this.__wbg_ptr);
819
462
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
820
463
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
821
464
  deferred1_0 = r0;
@@ -826,15 +469,29 @@ export class CartridgeAccountMeta {
826
469
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
827
470
  }
828
471
  }
472
+ /**
473
+ * @returns {Owner}
474
+ */
475
+ owner() {
476
+ const ret = wasm.cartridgeaccountmeta_owner(this.__wbg_ptr);
477
+ return takeObject(ret);
478
+ }
479
+ /**
480
+ * @returns {JsFelt}
481
+ */
482
+ ownerGuid() {
483
+ const ret = wasm.cartridgeaccountmeta_ownerGuid(this.__wbg_ptr);
484
+ return takeObject(ret);
485
+ }
829
486
  /**
830
487
  * @returns {string}
831
488
  */
832
- chainId() {
489
+ rpcUrl() {
833
490
  let deferred1_0;
834
491
  let deferred1_1;
835
492
  try {
836
493
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
837
- wasm.cartridgeaccountmeta_chainId(retptr, this.__wbg_ptr);
494
+ wasm.cartridgeaccountmeta_rpcUrl(retptr, this.__wbg_ptr);
838
495
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
839
496
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
840
497
  deferred1_0 = r0;
@@ -921,6 +578,26 @@ export class ControllerFactory {
921
578
  const ptr = this.__destroy_into_raw();
922
579
  wasm.__wbg_controllerfactory_free(ptr, 0);
923
580
  }
581
+ /**
582
+ * This should only be used with webauthn signers
583
+ * @param {string} username
584
+ * @param {JsFelt} class_hash
585
+ * @param {string} rpc_url
586
+ * @param {JsFelt} address
587
+ * @param {Owner} owner
588
+ * @param {string} cartridge_api_url
589
+ * @returns {Promise<CartridgeAccountWithMeta>}
590
+ */
591
+ static apiLogin(username, class_hash, rpc_url, address, owner, cartridge_api_url) {
592
+ const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
593
+ const len0 = WASM_VECTOR_LEN;
594
+ const ptr1 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
595
+ const len1 = WASM_VECTOR_LEN;
596
+ const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
597
+ const len2 = WASM_VECTOR_LEN;
598
+ const ret = wasm.controllerfactory_apiLogin(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2);
599
+ return takeObject(ret);
600
+ }
924
601
  /**
925
602
  * @param {string} cartridge_api_url
926
603
  * @returns {Promise<CartridgeAccountWithMeta | undefined>}
@@ -982,26 +659,6 @@ export class ControllerFactory {
982
659
  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);
983
660
  return takeObject(ret);
984
661
  }
985
- /**
986
- * This should only be used with webauthn signers
987
- * @param {string} username
988
- * @param {JsFelt} class_hash
989
- * @param {string} rpc_url
990
- * @param {JsFelt} address
991
- * @param {Owner} owner
992
- * @param {string} cartridge_api_url
993
- * @returns {Promise<CartridgeAccountWithMeta>}
994
- */
995
- static apiLogin(username, class_hash, rpc_url, address, owner, cartridge_api_url) {
996
- const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
997
- const len0 = WASM_VECTOR_LEN;
998
- const ptr1 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
999
- const len1 = WASM_VECTOR_LEN;
1000
- const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1001
- const len2 = WASM_VECTOR_LEN;
1002
- const ret = wasm.controllerfactory_apiLogin(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2);
1003
- return takeObject(ret);
1004
- }
1005
662
  }
1006
663
  if (Symbol.dispose) ControllerFactory.prototype[Symbol.dispose] = ControllerFactory.prototype.free;
1007
664
 
@@ -1104,6 +761,13 @@ export class JsChainConfig {
1104
761
  const ptr = this.__destroy_into_raw();
1105
762
  wasm.__wbg_jschainconfig_free(ptr, 0);
1106
763
  }
764
+ /**
765
+ * @returns {JsFelt | undefined}
766
+ */
767
+ get address() {
768
+ const ret = wasm.jschainconfig_address(this.__wbg_ptr);
769
+ return takeObject(ret);
770
+ }
1107
771
  /**
1108
772
  * @returns {JsFelt}
1109
773
  */
@@ -1132,13 +796,6 @@ export class JsChainConfig {
1132
796
  const ret = wasm.jschainconfig_owner(this.__wbg_ptr);
1133
797
  return takeObject(ret);
1134
798
  }
1135
- /**
1136
- * @returns {JsFelt | undefined}
1137
- */
1138
- get address() {
1139
- const ret = wasm.jschainconfig_address(this.__wbg_ptr);
1140
- return takeObject(ret);
1141
- }
1142
799
  /**
1143
800
  * @returns {string}
1144
801
  */
@@ -1187,10 +844,23 @@ export class JsControllerError {
1187
844
  return ret;
1188
845
  }
1189
846
  /**
1190
- * @param {ErrorCode} arg0
847
+ * @returns {string | undefined}
1191
848
  */
1192
- set code(arg0) {
1193
- wasm.__wbg_set_jscontrollererror_code(this.__wbg_ptr, arg0);
849
+ get data() {
850
+ try {
851
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
852
+ wasm.__wbg_get_jscontrollererror_data(retptr, this.__wbg_ptr);
853
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
854
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
855
+ let v1;
856
+ if (r0 !== 0) {
857
+ v1 = getStringFromWasm0(r0, r1).slice();
858
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
859
+ }
860
+ return v1;
861
+ } finally {
862
+ wasm.__wbindgen_add_to_stack_pointer(16);
863
+ }
1194
864
  }
1195
865
  /**
1196
866
  * @returns {string}
@@ -1212,31 +882,10 @@ export class JsControllerError {
1212
882
  }
1213
883
  }
1214
884
  /**
1215
- * @param {string} arg0
1216
- */
1217
- set message(arg0) {
1218
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1219
- const len0 = WASM_VECTOR_LEN;
1220
- wasm.__wbg_set_jscontrollererror_message(this.__wbg_ptr, ptr0, len0);
1221
- }
1222
- /**
1223
- * @returns {string | undefined}
885
+ * @param {ErrorCode} arg0
1224
886
  */
1225
- get data() {
1226
- try {
1227
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1228
- wasm.__wbg_get_jscontrollererror_data(retptr, this.__wbg_ptr);
1229
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1230
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1231
- let v1;
1232
- if (r0 !== 0) {
1233
- v1 = getStringFromWasm0(r0, r1).slice();
1234
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
1235
- }
1236
- return v1;
1237
- } finally {
1238
- wasm.__wbindgen_add_to_stack_pointer(16);
1239
- }
887
+ set code(arg0) {
888
+ wasm.__wbg_set_jscontrollererror_code(this.__wbg_ptr, arg0);
1240
889
  }
1241
890
  /**
1242
891
  * @param {string | null} [arg0]
@@ -1246,6 +895,14 @@ export class JsControllerError {
1246
895
  var len0 = WASM_VECTOR_LEN;
1247
896
  wasm.__wbg_set_jscontrollererror_data(this.__wbg_ptr, ptr0, len0);
1248
897
  }
898
+ /**
899
+ * @param {string} arg0
900
+ */
901
+ set message(arg0) {
902
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
903
+ const len0 = WASM_VECTOR_LEN;
904
+ wasm.__wbg_set_jscontrollererror_message(this.__wbg_ptr, ptr0, len0);
905
+ }
1249
906
  }
1250
907
  if (Symbol.dispose) JsControllerError.prototype[Symbol.dispose] = JsControllerError.prototype.free;
1251
908
 
@@ -1300,32 +957,23 @@ export class MultiChainAccount {
1300
957
  wasm.__wbg_multichainaccount_free(ptr, 0);
1301
958
  }
1302
959
  /**
1303
- * Gets an account instance for a specific chain
1304
- * @param {JsFelt} chain_id
1305
- * @returns {Promise<CartridgeAccount>}
1306
- */
1307
- controller(chain_id) {
1308
- const ret = wasm.multichainaccount_controller(this.__wbg_ptr, addHeapObject(chain_id));
1309
- return takeObject(ret);
1310
- }
1311
- /**
1312
- * Loads a MultiChainAccount from storage
1313
- * @param {string} cartridge_api_url
1314
- * @returns {Promise<MultiChainAccount | undefined>}
960
+ * Adds a new chain configuration
961
+ * @param {JsChainConfig} config
962
+ * @returns {Promise<void>}
1315
963
  */
1316
- static fromStorage(cartridge_api_url) {
1317
- const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1318
- const len0 = WASM_VECTOR_LEN;
1319
- const ret = wasm.multichainaccount_fromStorage(ptr0, len0);
964
+ addChain(config) {
965
+ _assertClass(config, JsChainConfig);
966
+ var ptr0 = config.__destroy_into_raw();
967
+ const ret = wasm.multichainaccount_addChain(this.__wbg_ptr, ptr0);
1320
968
  return takeObject(ret);
1321
969
  }
1322
970
  /**
1323
- * Removes a chain configuration
971
+ * Gets an account instance for a specific chain
1324
972
  * @param {JsFelt} chain_id
1325
- * @returns {Promise<void>}
973
+ * @returns {Promise<CartridgeAccount>}
1326
974
  */
1327
- removeChain(chain_id) {
1328
- const ret = wasm.multichainaccount_removeChain(this.__wbg_ptr, addHeapObject(chain_id));
975
+ controller(chain_id) {
976
+ const ret = wasm.multichainaccount_controller(this.__wbg_ptr, addHeapObject(chain_id));
1329
977
  return takeObject(ret);
1330
978
  }
1331
979
  /**
@@ -1346,14 +994,23 @@ export class MultiChainAccount {
1346
994
  return takeObject(ret);
1347
995
  }
1348
996
  /**
1349
- * Adds a new chain configuration
1350
- * @param {JsChainConfig} config
997
+ * Loads a MultiChainAccount from storage
998
+ * @param {string} cartridge_api_url
999
+ * @returns {Promise<MultiChainAccount | undefined>}
1000
+ */
1001
+ static fromStorage(cartridge_api_url) {
1002
+ const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1003
+ const len0 = WASM_VECTOR_LEN;
1004
+ const ret = wasm.multichainaccount_fromStorage(ptr0, len0);
1005
+ return takeObject(ret);
1006
+ }
1007
+ /**
1008
+ * Removes a chain configuration
1009
+ * @param {JsFelt} chain_id
1351
1010
  * @returns {Promise<void>}
1352
1011
  */
1353
- addChain(config) {
1354
- _assertClass(config, JsChainConfig);
1355
- var ptr0 = config.__destroy_into_raw();
1356
- const ret = wasm.multichainaccount_addChain(this.__wbg_ptr, ptr0);
1012
+ removeChain(chain_id) {
1013
+ const ret = wasm.multichainaccount_removeChain(this.__wbg_ptr, addHeapObject(chain_id));
1357
1014
  return takeObject(ret);
1358
1015
  }
1359
1016
  }
@@ -1478,231 +1135,187 @@ export function subscribeCreateSession(session_key_guid, cartridge_api_url) {
1478
1135
  const ret = wasm.subscribeCreateSession(addHeapObject(session_key_guid), ptr0, len0);
1479
1136
  return takeObject(ret);
1480
1137
  }
1481
-
1482
- export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
1138
+ export function __wbg_Error_8c4e43fe74559d73(arg0, arg1) {
1483
1139
  const ret = Error(getStringFromWasm0(arg0, arg1));
1484
1140
  return addHeapObject(ret);
1485
- };
1486
-
1141
+ }
1487
1142
  export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
1488
1143
  const ret = String(getObject(arg1));
1489
1144
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1490
1145
  const len1 = WASM_VECTOR_LEN;
1491
1146
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1492
1147
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1493
- };
1494
-
1495
- export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
1148
+ }
1149
+ export function __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25(arg0) {
1496
1150
  const v = getObject(arg0);
1497
1151
  const ret = typeof(v) === 'boolean' ? v : undefined;
1498
1152
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1499
- };
1500
-
1501
- export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
1153
+ }
1154
+ export function __wbg___wbindgen_debug_string_0bc8482c6e3508ae(arg0, arg1) {
1502
1155
  const ret = debugString(getObject(arg1));
1503
1156
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1504
1157
  const len1 = WASM_VECTOR_LEN;
1505
1158
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1506
1159
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1507
- };
1508
-
1509
- export function __wbg___wbindgen_in_0d3e1e8f0c669317(arg0, arg1) {
1160
+ }
1161
+ export function __wbg___wbindgen_in_47fa6863be6f2f25(arg0, arg1) {
1510
1162
  const ret = getObject(arg0) in getObject(arg1);
1511
1163
  return ret;
1512
- };
1513
-
1514
- export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
1164
+ }
1165
+ export function __wbg___wbindgen_is_function_0095a73b8b156f76(arg0) {
1515
1166
  const ret = typeof(getObject(arg0)) === 'function';
1516
1167
  return ret;
1517
- };
1518
-
1519
- export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
1168
+ }
1169
+ export function __wbg___wbindgen_is_object_5ae8e5880f2c1fbd(arg0) {
1520
1170
  const val = getObject(arg0);
1521
1171
  const ret = typeof(val) === 'object' && val !== null;
1522
1172
  return ret;
1523
- };
1524
-
1525
- export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
1173
+ }
1174
+ export function __wbg___wbindgen_is_string_cd444516edc5b180(arg0) {
1526
1175
  const ret = typeof(getObject(arg0)) === 'string';
1527
1176
  return ret;
1528
- };
1529
-
1530
- export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
1177
+ }
1178
+ export function __wbg___wbindgen_is_undefined_9e4d92534c42d778(arg0) {
1531
1179
  const ret = getObject(arg0) === undefined;
1532
1180
  return ret;
1533
- };
1534
-
1535
- export function __wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d(arg0, arg1) {
1181
+ }
1182
+ export function __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811(arg0, arg1) {
1536
1183
  const ret = getObject(arg0) == getObject(arg1);
1537
1184
  return ret;
1538
- };
1539
-
1540
- export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
1185
+ }
1186
+ export function __wbg___wbindgen_number_get_8ff4255516ccad3e(arg0, arg1) {
1541
1187
  const obj = getObject(arg1);
1542
1188
  const ret = typeof(obj) === 'number' ? obj : undefined;
1543
1189
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1544
1190
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1545
- };
1546
-
1547
- export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
1191
+ }
1192
+ export function __wbg___wbindgen_string_get_72fb696202c56729(arg0, arg1) {
1548
1193
  const obj = getObject(arg1);
1549
1194
  const ret = typeof(obj) === 'string' ? obj : undefined;
1550
1195
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1551
1196
  var len1 = WASM_VECTOR_LEN;
1552
1197
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1553
1198
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1554
- };
1555
-
1556
- export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
1199
+ }
1200
+ export function __wbg___wbindgen_throw_be289d5034ed271b(arg0, arg1) {
1557
1201
  throw new Error(getStringFromWasm0(arg0, arg1));
1558
- };
1559
-
1560
- export function __wbg__wbg_cb_unref_87dfb5aaa0cbcea7(arg0) {
1202
+ }
1203
+ export function __wbg__wbg_cb_unref_d9b87ff7982e3b21(arg0) {
1561
1204
  getObject(arg0)._wbg_cb_unref();
1562
- };
1563
-
1564
- export function __wbg_abort_07646c894ebbf2bd(arg0) {
1205
+ }
1206
+ export function __wbg_abort_2f0584e03e8e3950(arg0) {
1565
1207
  getObject(arg0).abort();
1566
- };
1567
-
1568
- export function __wbg_abort_399ecbcfd6ef3c8e(arg0, arg1) {
1208
+ }
1209
+ export function __wbg_abort_d549b92d3c665de1(arg0, arg1) {
1569
1210
  getObject(arg0).abort(getObject(arg1));
1570
- };
1571
-
1572
- export function __wbg_addEventListener_6a82629b3d430a48() { return handleError(function (arg0, arg1, arg2, arg3) {
1211
+ }
1212
+ export function __wbg_addEventListener_3acb0aad4483804c() { return handleError(function (arg0, arg1, arg2, arg3) {
1573
1213
  getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1574
- }, arguments) };
1575
-
1576
- export function __wbg_append_c5cbdf46455cc776() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1214
+ }, arguments); }
1215
+ export function __wbg_append_a992ccc37aa62dc4() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1577
1216
  getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1578
- }, arguments) };
1579
-
1580
- export function __wbg_arrayBuffer_c04af4fce566092d() { return handleError(function (arg0) {
1217
+ }, arguments); }
1218
+ export function __wbg_arrayBuffer_bb54076166006c39() { return handleError(function (arg0) {
1581
1219
  const ret = getObject(arg0).arrayBuffer();
1582
1220
  return addHeapObject(ret);
1583
- }, arguments) };
1584
-
1585
- export function __wbg_call_3020136f7a2d6e44() { return handleError(function (arg0, arg1, arg2) {
1586
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1587
- return addHeapObject(ret);
1588
- }, arguments) };
1589
-
1590
- export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
1221
+ }, arguments); }
1222
+ export function __wbg_call_389efe28435a9388() { return handleError(function (arg0, arg1) {
1591
1223
  const ret = getObject(arg0).call(getObject(arg1));
1592
1224
  return addHeapObject(ret);
1593
- }, arguments) };
1594
-
1225
+ }, arguments); }
1226
+ export function __wbg_call_4708e0c13bdc8e95() { return handleError(function (arg0, arg1, arg2) {
1227
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1228
+ return addHeapObject(ret);
1229
+ }, arguments); }
1595
1230
  export function __wbg_cartridgeaccount_new(arg0) {
1596
1231
  const ret = CartridgeAccount.__wrap(arg0);
1597
1232
  return addHeapObject(ret);
1598
- };
1599
-
1233
+ }
1600
1234
  export function __wbg_cartridgeaccountwithmeta_new(arg0) {
1601
1235
  const ret = CartridgeAccountWithMeta.__wrap(arg0);
1602
1236
  return addHeapObject(ret);
1603
- };
1604
-
1237
+ }
1605
1238
  export function __wbg_clearTimeout_42d9ccd50822fd3a(arg0) {
1606
1239
  const ret = clearTimeout(takeObject(arg0));
1607
1240
  return addHeapObject(ret);
1608
- };
1609
-
1610
- export function __wbg_clear_9fc28ed354d59d5e() { return handleError(function (arg0) {
1241
+ }
1242
+ export function __wbg_clear_67072e039373b0a4() { return handleError(function (arg0) {
1611
1243
  getObject(arg0).clear();
1612
- }, arguments) };
1613
-
1614
- export function __wbg_create_07d71296a0909e61() { return handleError(function (arg0, arg1) {
1244
+ }, arguments); }
1245
+ export function __wbg_create_6703e053182342f8() { return handleError(function (arg0, arg1) {
1615
1246
  const ret = getObject(arg0).create(getObject(arg1));
1616
1247
  return addHeapObject(ret);
1617
- }, arguments) };
1618
-
1619
- export function __wbg_credentials_36e0572b476d4883(arg0) {
1248
+ }, arguments); }
1249
+ export function __wbg_credentials_c8f18c5a8bda3a18(arg0) {
1620
1250
  const ret = getObject(arg0).credentials;
1621
1251
  return addHeapObject(ret);
1622
- };
1623
-
1624
- export function __wbg_crypto_574e78ad8b13b65f(arg0) {
1252
+ }
1253
+ export function __wbg_crypto_86f2631e91b51511(arg0) {
1625
1254
  const ret = getObject(arg0).crypto;
1626
1255
  return addHeapObject(ret);
1627
- };
1628
-
1629
- export function __wbg_data_8bf4ae669a78a688(arg0) {
1256
+ }
1257
+ export function __wbg_data_5330da50312d0bc1(arg0) {
1630
1258
  const ret = getObject(arg0).data;
1631
1259
  return addHeapObject(ret);
1632
- };
1633
-
1634
- export function __wbg_done_62ea16af4ce34b24(arg0) {
1260
+ }
1261
+ export function __wbg_done_57b39ecd9addfe81(arg0) {
1635
1262
  const ret = getObject(arg0).done;
1636
1263
  return ret;
1637
- };
1638
-
1639
- export function __wbg_error_7bc7d576a6aaf855(arg0) {
1264
+ }
1265
+ export function __wbg_error_9a7fe3f932034cde(arg0) {
1640
1266
  console.error(getObject(arg0));
1641
- };
1642
-
1267
+ }
1643
1268
  export function __wbg_fetch_6bbc32f991730587(arg0) {
1644
1269
  const ret = fetch(getObject(arg0));
1645
1270
  return addHeapObject(ret);
1646
- };
1647
-
1648
- export function __wbg_fetch_90447c28cc0b095e(arg0, arg1) {
1271
+ }
1272
+ export function __wbg_fetch_afb6a4b6cacf876d(arg0, arg1) {
1649
1273
  const ret = getObject(arg0).fetch(getObject(arg1));
1650
1274
  return addHeapObject(ret);
1651
- };
1652
-
1275
+ }
1653
1276
  export function __wbg_fetch_f1856afdb49415d1(arg0) {
1654
1277
  const ret = fetch(getObject(arg0));
1655
1278
  return addHeapObject(ret);
1656
- };
1657
-
1658
- export function __wbg_getClientExtensionResults_8668622b21a5eef7(arg0) {
1279
+ }
1280
+ export function __wbg_getClientExtensionResults_8f33db77a64c1fec(arg0) {
1659
1281
  const ret = getObject(arg0).getClientExtensionResults();
1660
1282
  return addHeapObject(ret);
1661
- };
1662
-
1663
- export function __wbg_getItem_1340bfc9a10d5991() { return handleError(function (arg0, arg1, arg2, arg3) {
1283
+ }
1284
+ export function __wbg_getItem_0c792d344808dcf5() { return handleError(function (arg0, arg1, arg2, arg3) {
1664
1285
  const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3));
1665
1286
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1666
1287
  var len1 = WASM_VECTOR_LEN;
1667
1288
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1668
1289
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1669
- }, arguments) };
1670
-
1671
- export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) {
1290
+ }, arguments); }
1291
+ export function __wbg_getRandomValues_b3f15fcbfabb0f8b() { return handleError(function (arg0, arg1) {
1672
1292
  getObject(arg0).getRandomValues(getObject(arg1));
1673
- }, arguments) };
1674
-
1675
- export function __wbg_getTime_ad1e9878a735af08(arg0) {
1293
+ }, arguments); }
1294
+ export function __wbg_getTime_1e3cd1391c5c3995(arg0) {
1676
1295
  const ret = getObject(arg0).getTime();
1677
1296
  return ret;
1678
- };
1679
-
1680
- export function __wbg_get_29726a9b608aea28() { return handleError(function (arg0, arg1) {
1297
+ }
1298
+ export function __wbg_get_4b6d542e6f171f17() { return handleError(function (arg0, arg1) {
1681
1299
  const ret = getObject(arg0).get(getObject(arg1));
1682
1300
  return addHeapObject(ret);
1683
- }, arguments) };
1684
-
1685
- export function __wbg_get_af9dab7e9603ea93() { return handleError(function (arg0, arg1) {
1301
+ }, arguments); }
1302
+ export function __wbg_get_b3ed3ad4be2bc8ac() { return handleError(function (arg0, arg1) {
1686
1303
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
1687
1304
  return addHeapObject(ret);
1688
- }, arguments) };
1689
-
1305
+ }, arguments); }
1690
1306
  export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
1691
1307
  const ret = getObject(arg0)[getObject(arg1)];
1692
1308
  return addHeapObject(ret);
1693
- };
1694
-
1695
- export function __wbg_has_0e670569d65d3a45() { return handleError(function (arg0, arg1) {
1309
+ }
1310
+ export function __wbg_has_d4e53238966c12b6() { return handleError(function (arg0, arg1) {
1696
1311
  const ret = Reflect.has(getObject(arg0), getObject(arg1));
1697
1312
  return ret;
1698
- }, arguments) };
1699
-
1700
- export function __wbg_headers_654c30e1bcccc552(arg0) {
1313
+ }, arguments); }
1314
+ export function __wbg_headers_59a2938db9f80985(arg0) {
1701
1315
  const ret = getObject(arg0).headers;
1702
1316
  return addHeapObject(ret);
1703
- };
1704
-
1705
- export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
1317
+ }
1318
+ export function __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04(arg0) {
1706
1319
  let result;
1707
1320
  try {
1708
1321
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -1711,9 +1324,8 @@ export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
1711
1324
  }
1712
1325
  const ret = result;
1713
1326
  return ret;
1714
- };
1715
-
1716
- export function __wbg_instanceof_Object_577e21051f7bcb79(arg0) {
1327
+ }
1328
+ export function __wbg_instanceof_Object_1c6af87502b733ed(arg0) {
1717
1329
  let result;
1718
1330
  try {
1719
1331
  result = getObject(arg0) instanceof Object;
@@ -1722,9 +1334,8 @@ export function __wbg_instanceof_Object_577e21051f7bcb79(arg0) {
1722
1334
  }
1723
1335
  const ret = result;
1724
1336
  return ret;
1725
- };
1726
-
1727
- export function __wbg_instanceof_Response_cd74d1c2ac92cb0b(arg0) {
1337
+ }
1338
+ export function __wbg_instanceof_Response_ee1d54d79ae41977(arg0) {
1728
1339
  let result;
1729
1340
  try {
1730
1341
  result = getObject(arg0) instanceof Response;
@@ -1733,9 +1344,8 @@ export function __wbg_instanceof_Response_cd74d1c2ac92cb0b(arg0) {
1733
1344
  }
1734
1345
  const ret = result;
1735
1346
  return ret;
1736
- };
1737
-
1738
- export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
1347
+ }
1348
+ export function __wbg_instanceof_Uint8Array_9b9075935c74707c(arg0) {
1739
1349
  let result;
1740
1350
  try {
1741
1351
  result = getObject(arg0) instanceof Uint8Array;
@@ -1744,9 +1354,8 @@ export function __wbg_instanceof_Uint8Array_da54ccc9d3e09434(arg0) {
1744
1354
  }
1745
1355
  const ret = result;
1746
1356
  return ret;
1747
- };
1748
-
1749
- export function __wbg_instanceof_Window_b5cf7783caa68180(arg0) {
1357
+ }
1358
+ export function __wbg_instanceof_Window_ed49b2db8df90359(arg0) {
1750
1359
  let result;
1751
1360
  try {
1752
1361
  result = getObject(arg0) instanceof Window;
@@ -1755,9 +1364,8 @@ export function __wbg_instanceof_Window_b5cf7783caa68180(arg0) {
1755
1364
  }
1756
1365
  const ret = result;
1757
1366
  return ret;
1758
- };
1759
-
1760
- export function __wbg_instanceof_WorkerGlobalScope_9a3411db21c65a54(arg0) {
1367
+ }
1368
+ export function __wbg_instanceof_WorkerGlobalScope_07b9d5514ff0156e(arg0) {
1761
1369
  let result;
1762
1370
  try {
1763
1371
  result = getObject(arg0) instanceof WorkerGlobalScope;
@@ -1766,110 +1374,78 @@ export function __wbg_instanceof_WorkerGlobalScope_9a3411db21c65a54(arg0) {
1766
1374
  }
1767
1375
  const ret = result;
1768
1376
  return ret;
1769
- };
1770
-
1771
- export function __wbg_iterator_27b7c8b35ab3e86b() {
1377
+ }
1378
+ export function __wbg_iterator_6ff6560ca1568e55() {
1772
1379
  const ret = Symbol.iterator;
1773
1380
  return addHeapObject(ret);
1774
- };
1775
-
1381
+ }
1776
1382
  export function __wbg_jschainconfig_unwrap(arg0) {
1777
1383
  const ret = JsChainConfig.__unwrap(getObject(arg0));
1778
1384
  return ret;
1779
- };
1780
-
1385
+ }
1781
1386
  export function __wbg_jscontrollererror_new(arg0) {
1782
1387
  const ret = JsControllerError.__wrap(arg0);
1783
1388
  return addHeapObject(ret);
1784
- };
1785
-
1786
- export function __wbg_length_22ac23eaec9d8053(arg0) {
1389
+ }
1390
+ export function __wbg_length_32ed9a279acd054c(arg0) {
1787
1391
  const ret = getObject(arg0).length;
1788
1392
  return ret;
1789
- };
1790
-
1791
- export function __wbg_localStorage_e7a9e9fee8fc608d() { return handleError(function (arg0) {
1393
+ }
1394
+ export function __wbg_localStorage_a22d31b9eacc4594() { return handleError(function (arg0) {
1792
1395
  const ret = getObject(arg0).localStorage;
1793
1396
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1794
- }, arguments) };
1795
-
1796
- export function __wbg_location_962e75c1c1b3ebed(arg0) {
1397
+ }, arguments); }
1398
+ export function __wbg_location_df7ca06c93e51763(arg0) {
1797
1399
  const ret = getObject(arg0).location;
1798
1400
  return addHeapObject(ret);
1799
- };
1800
-
1801
- export function __wbg_log_1d990106d99dacb7(arg0) {
1401
+ }
1402
+ export function __wbg_log_6b5ca2e6124b2808(arg0) {
1802
1403
  console.log(getObject(arg0));
1803
- };
1804
-
1404
+ }
1805
1405
  export function __wbg_loginresult_new(arg0) {
1806
1406
  const ret = LoginResult.__wrap(arg0);
1807
1407
  return addHeapObject(ret);
1808
- };
1809
-
1810
- export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
1408
+ }
1409
+ export function __wbg_msCrypto_d562bbe83e0d4b91(arg0) {
1811
1410
  const ret = getObject(arg0).msCrypto;
1812
1411
  return addHeapObject(ret);
1813
- };
1814
-
1412
+ }
1815
1413
  export function __wbg_multichainaccount_new(arg0) {
1816
1414
  const ret = MultiChainAccount.__wrap(arg0);
1817
1415
  return addHeapObject(ret);
1818
- };
1819
-
1820
- export function __wbg_navigator_b49edef831236138(arg0) {
1416
+ }
1417
+ export function __wbg_navigator_43be698ba96fc088(arg0) {
1821
1418
  const ret = getObject(arg0).navigator;
1822
1419
  return addHeapObject(ret);
1823
- };
1824
-
1825
- export function __wbg_new_0_23cedd11d9b40c9d() {
1420
+ }
1421
+ export function __wbg_new_0_73afc35eb544e539() {
1826
1422
  const ret = new Date();
1827
1423
  return addHeapObject(ret);
1828
- };
1829
-
1830
- export function __wbg_new_1ba21ce319a06297() {
1831
- const ret = new Object();
1832
- return addHeapObject(ret);
1833
- };
1834
-
1835
- export function __wbg_new_25f239778d6112b9() {
1836
- const ret = new Array();
1837
- return addHeapObject(ret);
1838
- };
1839
-
1424
+ }
1840
1425
  export function __wbg_new_2658d63118834d8e() {
1841
1426
  const ret = new Mutex();
1842
1427
  return addHeapObject(ret);
1843
- };
1844
-
1845
- export function __wbg_new_3c79b3bb1b32b7d3() { return handleError(function () {
1846
- const ret = new Headers();
1847
- return addHeapObject(ret);
1848
- }, arguments) };
1849
-
1850
- export function __wbg_new_6421f6084cc5bc5a(arg0) {
1851
- const ret = new Uint8Array(getObject(arg0));
1428
+ }
1429
+ export function __wbg_new_361308b2356cecd0() {
1430
+ const ret = new Object();
1852
1431
  return addHeapObject(ret);
1853
- };
1854
-
1855
- export function __wbg_new_881a222c65f168fc() { return handleError(function () {
1856
- const ret = new AbortController();
1432
+ }
1433
+ export function __wbg_new_3eb36ae241fe6f44() {
1434
+ const ret = new Array();
1857
1435
  return addHeapObject(ret);
1858
- }, arguments) };
1859
-
1860
- export function __wbg_new_b546ae120718850e() {
1861
- const ret = new Map();
1436
+ }
1437
+ export function __wbg_new_64284bd487f9d239() { return handleError(function () {
1438
+ const ret = new Headers();
1862
1439
  return addHeapObject(ret);
1863
- };
1864
-
1865
- export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
1440
+ }, arguments); }
1441
+ export function __wbg_new_b5d9e2fb389fef91(arg0, arg1) {
1866
1442
  try {
1867
1443
  var state0 = {a: arg0, b: arg1};
1868
1444
  var cb0 = (arg0, arg1) => {
1869
1445
  const a = state0.a;
1870
1446
  state0.a = 0;
1871
1447
  try {
1872
- return __wasm_bindgen_func_elem_10873(a, state0.b, arg0, arg1);
1448
+ return __wasm_bindgen_func_elem_10920(a, state0.b, arg0, arg1);
1873
1449
  } finally {
1874
1450
  state0.a = a;
1875
1451
  }
@@ -1879,355 +1455,639 @@ export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
1879
1455
  } finally {
1880
1456
  state0.a = state0.b = 0;
1881
1457
  }
1882
- };
1883
-
1884
- export function __wbg_new_from_slice_f9c22b9153b26992(arg0, arg1) {
1458
+ }
1459
+ export function __wbg_new_b949e7f56150a5d1() { return handleError(function () {
1460
+ const ret = new AbortController();
1461
+ return addHeapObject(ret);
1462
+ }, arguments); }
1463
+ export function __wbg_new_dca287b076112a51() {
1464
+ const ret = new Map();
1465
+ return addHeapObject(ret);
1466
+ }
1467
+ export function __wbg_new_dd2b680c8bf6ae29(arg0) {
1468
+ const ret = new Uint8Array(getObject(arg0));
1469
+ return addHeapObject(ret);
1470
+ }
1471
+ export function __wbg_new_from_slice_a3d2629dc1826784(arg0, arg1) {
1885
1472
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1886
1473
  return addHeapObject(ret);
1887
- };
1888
-
1889
- export function __wbg_new_no_args_cb138f77cf6151ee(arg0, arg1) {
1474
+ }
1475
+ export function __wbg_new_no_args_1c7c842f08d00ebb(arg0, arg1) {
1890
1476
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1891
1477
  return addHeapObject(ret);
1892
- };
1893
-
1894
- export function __wbg_new_with_length_aa5eaf41d35235e5(arg0) {
1478
+ }
1479
+ export function __wbg_new_with_length_a2c39cbe88fd8ff1(arg0) {
1895
1480
  const ret = new Uint8Array(arg0 >>> 0);
1896
1481
  return addHeapObject(ret);
1897
- };
1898
-
1899
- export function __wbg_new_with_str_and_init_c5748f76f5108934() { return handleError(function (arg0, arg1, arg2) {
1900
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1482
+ }
1483
+ export function __wbg_new_with_str_and_init_a61cbc6bdef21614() { return handleError(function (arg0, arg1, arg2) {
1484
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1485
+ return addHeapObject(ret);
1486
+ }, arguments); }
1487
+ export function __wbg_next_3482f54c49e8af19() { return handleError(function (arg0) {
1488
+ const ret = getObject(arg0).next();
1489
+ return addHeapObject(ret);
1490
+ }, arguments); }
1491
+ export function __wbg_next_418f80d8f5303233(arg0) {
1492
+ const ret = getObject(arg0).next;
1493
+ return addHeapObject(ret);
1494
+ }
1495
+ export function __wbg_node_e1f24f89a7336c2e(arg0) {
1496
+ const ret = getObject(arg0).node;
1497
+ return addHeapObject(ret);
1498
+ }
1499
+ export function __wbg_now_a3af9a2f4bbaa4d1() {
1500
+ const ret = Date.now();
1501
+ return ret;
1502
+ }
1503
+ export function __wbg_obtain_a9626b3b96e6dc2c(arg0) {
1504
+ const ret = getObject(arg0).obtain();
1505
+ return addHeapObject(ret);
1506
+ }
1507
+ export function __wbg_open_d7691c490eaf9349() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1508
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6));
1509
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1510
+ }, arguments); }
1511
+ export function __wbg_origin_a9c891fa602b4d40() { return handleError(function (arg0, arg1) {
1512
+ const ret = getObject(arg1).origin;
1513
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1514
+ const len1 = WASM_VECTOR_LEN;
1515
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1516
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1517
+ }, arguments); }
1518
+ export function __wbg_origin_ea1e188117b6dcf9(arg0, arg1) {
1519
+ const ret = getObject(arg1).origin;
1520
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1521
+ const len1 = WASM_VECTOR_LEN;
1522
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1523
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1524
+ }
1525
+ export function __wbg_parse_9e3ea228dba1cc2a(arg0, arg1) {
1526
+ let deferred0_0;
1527
+ let deferred0_1;
1528
+ try {
1529
+ deferred0_0 = arg0;
1530
+ deferred0_1 = arg1;
1531
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1532
+ return addHeapObject(ret);
1533
+ } finally {
1534
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1535
+ }
1536
+ }
1537
+ export function __wbg_process_3975fd6c72f520aa(arg0) {
1538
+ const ret = getObject(arg0).process;
1539
+ return addHeapObject(ret);
1540
+ }
1541
+ export function __wbg_prototypesetcall_bdcdcc5842e4d77d(arg0, arg1, arg2) {
1542
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1543
+ }
1544
+ export function __wbg_push_8ffdcb2063340ba5(arg0, arg1) {
1545
+ const ret = getObject(arg0).push(getObject(arg1));
1546
+ return ret;
1547
+ }
1548
+ export function __wbg_queueMicrotask_0aa0a927f78f5d98(arg0) {
1549
+ const ret = getObject(arg0).queueMicrotask;
1550
+ return addHeapObject(ret);
1551
+ }
1552
+ export function __wbg_queueMicrotask_5bb536982f78a56f(arg0) {
1553
+ queueMicrotask(getObject(arg0));
1554
+ }
1555
+ export function __wbg_randomFillSync_f8c153b79f285817() { return handleError(function (arg0, arg1) {
1556
+ getObject(arg0).randomFillSync(takeObject(arg1));
1557
+ }, arguments); }
1558
+ export function __wbg_removeEventListener_e63328781a5b9af9() { return handleError(function (arg0, arg1, arg2, arg3) {
1559
+ getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1560
+ }, arguments); }
1561
+ export function __wbg_removeItem_f6369b1a6fa39850() { return handleError(function (arg0, arg1, arg2) {
1562
+ getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2));
1563
+ }, arguments); }
1564
+ export function __wbg_require_b74f47fc2d022fd6() { return handleError(function () {
1565
+ const ret = module.require;
1566
+ return addHeapObject(ret);
1567
+ }, arguments); }
1568
+ export function __wbg_resolve_002c4b7d9d8f6b64(arg0) {
1569
+ const ret = Promise.resolve(getObject(arg0));
1570
+ return addHeapObject(ret);
1571
+ }
1572
+ export function __wbg_setItem_cf340bb2edbd3089() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1573
+ getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1574
+ }, arguments); }
1575
+ export function __wbg_setTimeout_4ec014681668a581(arg0, arg1) {
1576
+ const ret = setTimeout(getObject(arg0), arg1);
1577
+ return addHeapObject(ret);
1578
+ }
1579
+ export function __wbg_setTimeout_e0aacd5a637418a6() { return handleError(function (arg0, arg1, arg2) {
1580
+ const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
1581
+ return ret;
1582
+ }, arguments); }
1583
+ export function __wbg_setTimeout_eff32631ea138533() { return handleError(function (arg0, arg1, arg2) {
1584
+ const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
1585
+ return ret;
1586
+ }, arguments); }
1587
+ export function __wbg_set_1eb0999cf5d27fc8(arg0, arg1, arg2) {
1588
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1589
+ return addHeapObject(ret);
1590
+ }
1591
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
1592
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1593
+ }
1594
+ export function __wbg_set_3fda3bac07393de4(arg0, arg1, arg2) {
1595
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1596
+ }
1597
+ export function __wbg_set_6cb8631f80447a67() { return handleError(function (arg0, arg1, arg2) {
1598
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1599
+ return ret;
1600
+ }, arguments); }
1601
+ export function __wbg_set_body_9a7e00afe3cfe244(arg0, arg1) {
1602
+ getObject(arg0).body = getObject(arg1);
1603
+ }
1604
+ export function __wbg_set_cache_315a3ed773a41543(arg0, arg1) {
1605
+ getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
1606
+ }
1607
+ export function __wbg_set_credentials_c4a58d2e05ef24fb(arg0, arg1) {
1608
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
1609
+ }
1610
+ export function __wbg_set_f43e577aea94465b(arg0, arg1, arg2) {
1611
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1612
+ }
1613
+ export function __wbg_set_headers_cfc5f4b2c1f20549(arg0, arg1) {
1614
+ getObject(arg0).headers = getObject(arg1);
1615
+ }
1616
+ export function __wbg_set_method_c3e20375f5ae7fac(arg0, arg1, arg2) {
1617
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1618
+ }
1619
+ export function __wbg_set_mode_b13642c312648202(arg0, arg1) {
1620
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
1621
+ }
1622
+ export function __wbg_set_signal_f2d3f8599248896d(arg0, arg1) {
1623
+ getObject(arg0).signal = getObject(arg1);
1624
+ }
1625
+ export function __wbg_signMessage_c732ea9d998cac79() { return handleError(function (arg0, arg1, arg2, arg3) {
1626
+ let deferred0_0;
1627
+ let deferred0_1;
1628
+ let deferred1_0;
1629
+ let deferred1_1;
1630
+ try {
1631
+ deferred0_0 = arg0;
1632
+ deferred0_1 = arg1;
1633
+ deferred1_0 = arg2;
1634
+ deferred1_1 = arg3;
1635
+ const ret = window.keychain_wallets.signMessage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1636
+ return addHeapObject(ret);
1637
+ } finally {
1638
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1639
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1640
+ }
1641
+ }, arguments); }
1642
+ export function __wbg_signal_d1285ecab4ebc5ad(arg0) {
1643
+ const ret = getObject(arg0).signal;
1644
+ return addHeapObject(ret);
1645
+ }
1646
+ export function __wbg_static_accessor_GLOBAL_12837167ad935116() {
1647
+ const ret = typeof global === 'undefined' ? null : global;
1648
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1649
+ }
1650
+ export function __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f() {
1651
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1652
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1653
+ }
1654
+ export function __wbg_static_accessor_SELF_a621d3dfbb60d0ce() {
1655
+ const ret = typeof self === 'undefined' ? null : self;
1656
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1657
+ }
1658
+ export function __wbg_static_accessor_WINDOW_f8727f0cf888e0bd() {
1659
+ const ret = typeof window === 'undefined' ? null : window;
1660
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1661
+ }
1662
+ export function __wbg_status_89d7e803db911ee7(arg0) {
1663
+ const ret = getObject(arg0).status;
1664
+ return ret;
1665
+ }
1666
+ export function __wbg_stringify_8d1cc6ff383e8bae() { return handleError(function (arg0) {
1667
+ const ret = JSON.stringify(getObject(arg0));
1901
1668
  return addHeapObject(ret);
1902
- }, arguments) };
1903
-
1904
- export function __wbg_next_138a17bbf04e926c(arg0) {
1905
- const ret = getObject(arg0).next;
1669
+ }, arguments); }
1670
+ export function __wbg_stringify_e4a940b133e6b7d8(arg0, arg1) {
1671
+ const ret = JSON.stringify(getObject(arg1));
1672
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1673
+ var len1 = WASM_VECTOR_LEN;
1674
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1675
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1676
+ }
1677
+ export function __wbg_subarray_a96e1fef17ed23cb(arg0, arg1, arg2) {
1678
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1906
1679
  return addHeapObject(ret);
1907
- };
1908
-
1909
- export function __wbg_next_3cfe5c0fe2a4cc53() { return handleError(function (arg0) {
1910
- const ret = getObject(arg0).next();
1680
+ }
1681
+ export function __wbg_text_083b8727c990c8c0() { return handleError(function (arg0) {
1682
+ const ret = getObject(arg0).text();
1911
1683
  return addHeapObject(ret);
1912
- }, arguments) };
1913
-
1914
- export function __wbg_node_905d3e251edff8a2(arg0) {
1915
- const ret = getObject(arg0).node;
1684
+ }, arguments); }
1685
+ export function __wbg_then_0d9fe2c7b1857d32(arg0, arg1, arg2) {
1686
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1916
1687
  return addHeapObject(ret);
1917
- };
1918
-
1919
- export function __wbg_now_69d776cd24f5215b() {
1920
- const ret = Date.now();
1921
- return ret;
1922
- };
1923
-
1924
- export function __wbg_obtain_a9626b3b96e6dc2c(arg0) {
1925
- const ret = getObject(arg0).obtain();
1688
+ }
1689
+ export function __wbg_then_b9e7b3b5f1a9e1b5(arg0, arg1) {
1690
+ const ret = getObject(arg0).then(getObject(arg1));
1926
1691
  return addHeapObject(ret);
1927
- };
1928
-
1929
- export function __wbg_open_1611d5d1a9d8cf79() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
1930
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getStringFromWasm0(arg5, arg6));
1931
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1932
- }, arguments) };
1933
-
1934
- export function __wbg_origin_4ab782e7fd21eede(arg0, arg1) {
1935
- const ret = getObject(arg1).origin;
1692
+ }
1693
+ export function __wbg_url_c484c26b1fbf5126(arg0, arg1) {
1694
+ const ret = getObject(arg1).url;
1936
1695
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1937
1696
  const len1 = WASM_VECTOR_LEN;
1938
1697
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1939
1698
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1940
- };
1941
-
1942
- export function __wbg_origin_c4ac149104b9ebad() { return handleError(function (arg0, arg1) {
1943
- const ret = getObject(arg1).origin;
1699
+ }
1700
+ export function __wbg_userAgent_34463fd660ba4a2a() { return handleError(function (arg0, arg1) {
1701
+ const ret = getObject(arg1).userAgent;
1944
1702
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1945
1703
  const len1 = WASM_VECTOR_LEN;
1946
1704
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1947
1705
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1948
- }, arguments) };
1949
-
1950
- export function __wbg_parse_7ff95c018af680b3(arg0, arg1) {
1951
- let deferred0_0;
1952
- let deferred0_1;
1953
- try {
1954
- deferred0_0 = arg0;
1955
- deferred0_1 = arg1;
1956
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1957
- return addHeapObject(ret);
1958
- } finally {
1959
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
1960
- }
1961
- };
1962
-
1963
- export function __wbg_process_dc0fbacc7c1c06f7(arg0) {
1964
- const ret = getObject(arg0).process;
1706
+ }, arguments); }
1707
+ export function __wbg_value_0546255b415e96c1(arg0) {
1708
+ const ret = getObject(arg0).value;
1965
1709
  return addHeapObject(ret);
1966
- };
1967
-
1968
- export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
1969
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1970
- };
1971
-
1972
- export function __wbg_push_7d9be8f38fc13975(arg0, arg1) {
1973
- const ret = getObject(arg0).push(getObject(arg1));
1974
- return ret;
1975
- };
1976
-
1977
- export function __wbg_queueMicrotask_9b549dfce8865860(arg0) {
1978
- const ret = getObject(arg0).queueMicrotask;
1710
+ }
1711
+ export function __wbg_versions_4e31226f5e8dc909(arg0) {
1712
+ const ret = getObject(arg0).versions;
1979
1713
  return addHeapObject(ret);
1980
- };
1981
-
1982
- export function __wbg_queueMicrotask_fca69f5bfad613a5(arg0) {
1983
- queueMicrotask(getObject(arg0));
1984
- };
1985
-
1986
- export function __wbg_randomFillSync_ac0988aba3254290() { return handleError(function (arg0, arg1) {
1987
- getObject(arg0).randomFillSync(takeObject(arg1));
1988
- }, arguments) };
1989
-
1990
- export function __wbg_removeEventListener_565e273024b68b75() { return handleError(function (arg0, arg1, arg2, arg3) {
1991
- getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
1992
- }, arguments) };
1714
+ }
1715
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
1716
+ // 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`.
1717
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_235, __wasm_bindgen_func_elem_3294);
1718
+ return addHeapObject(ret);
1719
+ }
1720
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
1721
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1003, function: Function { arguments: [Externref], shim_idx: 1004, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1722
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8813, __wasm_bindgen_func_elem_8828);
1723
+ return addHeapObject(ret);
1724
+ }
1725
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
1726
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 968, function: Function { arguments: [], shim_idx: 969, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1727
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8669, __wasm_bindgen_func_elem_8678);
1728
+ return addHeapObject(ret);
1729
+ }
1730
+ export function __wbindgen_cast_0000000000000004(arg0) {
1731
+ // Cast intrinsic for `F64 -> Externref`.
1732
+ const ret = arg0;
1733
+ return addHeapObject(ret);
1734
+ }
1735
+ export function __wbindgen_cast_0000000000000005(arg0) {
1736
+ // Cast intrinsic for `I64 -> Externref`.
1737
+ const ret = arg0;
1738
+ return addHeapObject(ret);
1739
+ }
1740
+ export function __wbindgen_cast_0000000000000006(arg0, arg1) {
1741
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1742
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1743
+ return addHeapObject(ret);
1744
+ }
1745
+ export function __wbindgen_cast_0000000000000007(arg0, arg1) {
1746
+ // Cast intrinsic for `Ref(String) -> Externref`.
1747
+ const ret = getStringFromWasm0(arg0, arg1);
1748
+ return addHeapObject(ret);
1749
+ }
1750
+ export function __wbindgen_object_clone_ref(arg0) {
1751
+ const ret = getObject(arg0);
1752
+ return addHeapObject(ret);
1753
+ }
1754
+ export function __wbindgen_object_drop_ref(arg0) {
1755
+ takeObject(arg0);
1756
+ }
1757
+ function __wasm_bindgen_func_elem_8678(arg0, arg1) {
1758
+ wasm.__wasm_bindgen_func_elem_8678(arg0, arg1);
1759
+ }
1993
1760
 
1994
- export function __wbg_removeItem_33ed1aeb2dc68e96() { return handleError(function (arg0, arg1, arg2) {
1995
- getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2));
1996
- }, arguments) };
1761
+ function __wasm_bindgen_func_elem_3294(arg0, arg1, arg2) {
1762
+ wasm.__wasm_bindgen_func_elem_3294(arg0, arg1, addHeapObject(arg2));
1763
+ }
1997
1764
 
1998
- export function __wbg_require_60cc747a6bc5215a() { return handleError(function () {
1999
- const ret = module.require;
2000
- return addHeapObject(ret);
2001
- }, arguments) };
1765
+ function __wasm_bindgen_func_elem_8828(arg0, arg1, arg2) {
1766
+ wasm.__wasm_bindgen_func_elem_8828(arg0, arg1, addHeapObject(arg2));
1767
+ }
2002
1768
 
2003
- export function __wbg_resolve_fd5bfbaa4ce36e1e(arg0) {
2004
- const ret = Promise.resolve(getObject(arg0));
2005
- return addHeapObject(ret);
2006
- };
1769
+ function __wasm_bindgen_func_elem_10920(arg0, arg1, arg2, arg3) {
1770
+ wasm.__wasm_bindgen_func_elem_10920(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1771
+ }
2007
1772
 
2008
- export function __wbg_setItem_1167ad38996d6426() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2009
- getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2010
- }, arguments) };
2011
1773
 
2012
- export function __wbg_setTimeout_06477c23d31efef1() { return handleError(function (arg0, arg1, arg2) {
2013
- const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
2014
- return ret;
2015
- }, arguments) };
1774
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
2016
1775
 
2017
- export function __wbg_setTimeout_425032fd8860bd1e() { return handleError(function (arg0, arg1, arg2) {
2018
- const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
2019
- return ret;
2020
- }, arguments) };
2021
1776
 
2022
- export function __wbg_setTimeout_4ec014681668a581(arg0, arg1) {
2023
- const ret = setTimeout(getObject(arg0), arg1);
2024
- return addHeapObject(ret);
2025
- };
1777
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
2026
1778
 
2027
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
2028
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2029
- };
2030
1779
 
2031
- export function __wbg_set_3fda3bac07393de4(arg0, arg1, arg2) {
2032
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2033
- };
1780
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1781
+ const CartridgeAccountFinalization = (typeof FinalizationRegistry === 'undefined')
1782
+ ? { register: () => {}, unregister: () => {} }
1783
+ : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccount_free(ptr >>> 0, 1));
1784
+ const CartridgeAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1785
+ ? { register: () => {}, unregister: () => {} }
1786
+ : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountmeta_free(ptr >>> 0, 1));
1787
+ const CartridgeAccountWithMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1788
+ ? { register: () => {}, unregister: () => {} }
1789
+ : new FinalizationRegistry(ptr => wasm.__wbg_cartridgeaccountwithmeta_free(ptr >>> 0, 1));
1790
+ const ControllerFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
1791
+ ? { register: () => {}, unregister: () => {} }
1792
+ : new FinalizationRegistry(ptr => wasm.__wbg_controllerfactory_free(ptr >>> 0, 1));
1793
+ const JsChainConfigFinalization = (typeof FinalizationRegistry === 'undefined')
1794
+ ? { register: () => {}, unregister: () => {} }
1795
+ : new FinalizationRegistry(ptr => wasm.__wbg_jschainconfig_free(ptr >>> 0, 1));
1796
+ const JsControllerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1797
+ ? { register: () => {}, unregister: () => {} }
1798
+ : new FinalizationRegistry(ptr => wasm.__wbg_jscontrollererror_free(ptr >>> 0, 1));
1799
+ const LoginResultFinalization = (typeof FinalizationRegistry === 'undefined')
1800
+ ? { register: () => {}, unregister: () => {} }
1801
+ : new FinalizationRegistry(ptr => wasm.__wbg_loginresult_free(ptr >>> 0, 1));
1802
+ const MultiChainAccountFinalization = (typeof FinalizationRegistry === 'undefined')
1803
+ ? { register: () => {}, unregister: () => {} }
1804
+ : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccount_free(ptr >>> 0, 1));
1805
+ const MultiChainAccountMetaFinalization = (typeof FinalizationRegistry === 'undefined')
1806
+ ? { register: () => {}, unregister: () => {} }
1807
+ : new FinalizationRegistry(ptr => wasm.__wbg_multichainaccountmeta_free(ptr >>> 0, 1));
2034
1808
 
2035
- export function __wbg_set_781438a03c0c3c81() { return handleError(function (arg0, arg1, arg2) {
2036
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2037
- return ret;
2038
- }, arguments) };
1809
+ function addHeapObject(obj) {
1810
+ if (heap_next === heap.length) heap.push(heap.length + 1);
1811
+ const idx = heap_next;
1812
+ heap_next = heap[idx];
2039
1813
 
2040
- export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
2041
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2042
- };
1814
+ heap[idx] = obj;
1815
+ return idx;
1816
+ }
2043
1817
 
2044
- export function __wbg_set_body_8e743242d6076a4f(arg0, arg1) {
2045
- getObject(arg0).body = getObject(arg1);
2046
- };
1818
+ function _assertClass(instance, klass) {
1819
+ if (!(instance instanceof klass)) {
1820
+ throw new Error(`expected instance of ${klass.name}`);
1821
+ }
1822
+ }
2047
1823
 
2048
- export function __wbg_set_cache_0e437c7c8e838b9b(arg0, arg1) {
2049
- getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
2050
- };
1824
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1825
+ ? { register: () => {}, unregister: () => {} }
1826
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
2051
1827
 
2052
- export function __wbg_set_credentials_55ae7c3c106fd5be(arg0, arg1) {
2053
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
2054
- };
1828
+ function debugString(val) {
1829
+ // primitive types
1830
+ const type = typeof val;
1831
+ if (type == 'number' || type == 'boolean' || val == null) {
1832
+ return `${val}`;
1833
+ }
1834
+ if (type == 'string') {
1835
+ return `"${val}"`;
1836
+ }
1837
+ if (type == 'symbol') {
1838
+ const description = val.description;
1839
+ if (description == null) {
1840
+ return 'Symbol';
1841
+ } else {
1842
+ return `Symbol(${description})`;
1843
+ }
1844
+ }
1845
+ if (type == 'function') {
1846
+ const name = val.name;
1847
+ if (typeof name == 'string' && name.length > 0) {
1848
+ return `Function(${name})`;
1849
+ } else {
1850
+ return 'Function';
1851
+ }
1852
+ }
1853
+ // objects
1854
+ if (Array.isArray(val)) {
1855
+ const length = val.length;
1856
+ let debug = '[';
1857
+ if (length > 0) {
1858
+ debug += debugString(val[0]);
1859
+ }
1860
+ for(let i = 1; i < length; i++) {
1861
+ debug += ', ' + debugString(val[i]);
1862
+ }
1863
+ debug += ']';
1864
+ return debug;
1865
+ }
1866
+ // Test for built-in
1867
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1868
+ let className;
1869
+ if (builtInMatches && builtInMatches.length > 1) {
1870
+ className = builtInMatches[1];
1871
+ } else {
1872
+ // Failed to match the standard '[object ClassName]'
1873
+ return toString.call(val);
1874
+ }
1875
+ if (className == 'Object') {
1876
+ // we're a user defined class or Object
1877
+ // JSON.stringify avoids problems with cycles, and is generally much
1878
+ // easier than looping through ownProperties of `val`.
1879
+ try {
1880
+ return 'Object(' + JSON.stringify(val) + ')';
1881
+ } catch (_) {
1882
+ return 'Object';
1883
+ }
1884
+ }
1885
+ // errors
1886
+ if (val instanceof Error) {
1887
+ return `${val.name}: ${val.message}\n${val.stack}`;
1888
+ }
1889
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1890
+ return className;
1891
+ }
2055
1892
 
2056
- export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
2057
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2058
- return addHeapObject(ret);
2059
- };
1893
+ function dropObject(idx) {
1894
+ if (idx < 132) return;
1895
+ heap[idx] = heap_next;
1896
+ heap_next = idx;
1897
+ }
2060
1898
 
2061
- export function __wbg_set_headers_5671cf088e114d2b(arg0, arg1) {
2062
- getObject(arg0).headers = getObject(arg1);
2063
- };
1899
+ function getArrayJsValueFromWasm0(ptr, len) {
1900
+ ptr = ptr >>> 0;
1901
+ const mem = getDataViewMemory0();
1902
+ const result = [];
1903
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1904
+ result.push(takeObject(mem.getUint32(i, true)));
1905
+ }
1906
+ return result;
1907
+ }
2064
1908
 
2065
- export function __wbg_set_method_76c69e41b3570627(arg0, arg1, arg2) {
2066
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
2067
- };
1909
+ function getArrayU8FromWasm0(ptr, len) {
1910
+ ptr = ptr >>> 0;
1911
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1912
+ }
2068
1913
 
2069
- export function __wbg_set_mode_611016a6818fc690(arg0, arg1) {
2070
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
2071
- };
1914
+ let cachedDataViewMemory0 = null;
1915
+ function getDataViewMemory0() {
1916
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1917
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1918
+ }
1919
+ return cachedDataViewMemory0;
1920
+ }
2072
1921
 
2073
- export function __wbg_set_signal_e89be862d0091009(arg0, arg1) {
2074
- getObject(arg0).signal = getObject(arg1);
2075
- };
1922
+ function getStringFromWasm0(ptr, len) {
1923
+ ptr = ptr >>> 0;
1924
+ return decodeText(ptr, len);
1925
+ }
2076
1926
 
2077
- export function __wbg_signMessage_c732ea9d998cac79() { return handleError(function (arg0, arg1, arg2, arg3) {
2078
- let deferred0_0;
2079
- let deferred0_1;
2080
- let deferred1_0;
2081
- let deferred1_1;
2082
- try {
2083
- deferred0_0 = arg0;
2084
- deferred0_1 = arg1;
2085
- deferred1_0 = arg2;
2086
- deferred1_1 = arg3;
2087
- const ret = window.keychain_wallets.signMessage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
2088
- return addHeapObject(ret);
2089
- } finally {
2090
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2091
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1927
+ let cachedUint8ArrayMemory0 = null;
1928
+ function getUint8ArrayMemory0() {
1929
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1930
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2092
1931
  }
2093
- }, arguments) };
2094
-
2095
- export function __wbg_signal_3c14fbdc89694b39(arg0) {
2096
- const ret = getObject(arg0).signal;
2097
- return addHeapObject(ret);
2098
- };
1932
+ return cachedUint8ArrayMemory0;
1933
+ }
2099
1934
 
2100
- export function __wbg_static_accessor_GLOBAL_769e6b65d6557335() {
2101
- const ret = typeof global === 'undefined' ? null : global;
2102
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2103
- };
1935
+ function getObject(idx) { return heap[idx]; }
2104
1936
 
2105
- export function __wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1() {
2106
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
2107
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2108
- };
1937
+ function handleError(f, args) {
1938
+ try {
1939
+ return f.apply(this, args);
1940
+ } catch (e) {
1941
+ wasm.__wbindgen_export3(addHeapObject(e));
1942
+ }
1943
+ }
2109
1944
 
2110
- export function __wbg_static_accessor_SELF_08f5a74c69739274() {
2111
- const ret = typeof self === 'undefined' ? null : self;
2112
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2113
- };
1945
+ let heap = new Array(128).fill(undefined);
1946
+ heap.push(undefined, null, true, false);
2114
1947
 
2115
- export function __wbg_static_accessor_WINDOW_a8924b26aa92d024() {
2116
- const ret = typeof window === 'undefined' ? null : window;
2117
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2118
- };
1948
+ let heap_next = heap.length;
2119
1949
 
2120
- export function __wbg_status_9bfc680efca4bdfd(arg0) {
2121
- const ret = getObject(arg0).status;
2122
- return ret;
2123
- };
1950
+ function isLikeNone(x) {
1951
+ return x === undefined || x === null;
1952
+ }
2124
1953
 
2125
- export function __wbg_stringify_56d3c6664110414f(arg0, arg1) {
2126
- const ret = JSON.stringify(getObject(arg1));
2127
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2128
- var len1 = WASM_VECTOR_LEN;
2129
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2130
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2131
- };
1954
+ function makeClosure(arg0, arg1, dtor, f) {
1955
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1956
+ const real = (...args) => {
2132
1957
 
2133
- export function __wbg_stringify_655a6390e1f5eb6b() { return handleError(function (arg0) {
2134
- const ret = JSON.stringify(getObject(arg0));
2135
- return addHeapObject(ret);
2136
- }, arguments) };
1958
+ // First up with a closure we increment the internal reference
1959
+ // count. This ensures that the Rust closure environment won't
1960
+ // be deallocated while we're invoking it.
1961
+ state.cnt++;
1962
+ try {
1963
+ return f(state.a, state.b, ...args);
1964
+ } finally {
1965
+ real._wbg_cb_unref();
1966
+ }
1967
+ };
1968
+ real._wbg_cb_unref = () => {
1969
+ if (--state.cnt === 0) {
1970
+ state.dtor(state.a, state.b);
1971
+ state.a = 0;
1972
+ CLOSURE_DTORS.unregister(state);
1973
+ }
1974
+ };
1975
+ CLOSURE_DTORS.register(real, state, state);
1976
+ return real;
1977
+ }
2137
1978
 
2138
- export function __wbg_subarray_845f2f5bce7d061a(arg0, arg1, arg2) {
2139
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2140
- return addHeapObject(ret);
2141
- };
1979
+ function makeMutClosure(arg0, arg1, dtor, f) {
1980
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1981
+ const real = (...args) => {
2142
1982
 
2143
- export function __wbg_text_51046bb33d257f63() { return handleError(function (arg0) {
2144
- const ret = getObject(arg0).text();
2145
- return addHeapObject(ret);
2146
- }, arguments) };
1983
+ // First up with a closure we increment the internal reference
1984
+ // count. This ensures that the Rust closure environment won't
1985
+ // be deallocated while we're invoking it.
1986
+ state.cnt++;
1987
+ const a = state.a;
1988
+ state.a = 0;
1989
+ try {
1990
+ return f(a, state.b, ...args);
1991
+ } finally {
1992
+ state.a = a;
1993
+ real._wbg_cb_unref();
1994
+ }
1995
+ };
1996
+ real._wbg_cb_unref = () => {
1997
+ if (--state.cnt === 0) {
1998
+ state.dtor(state.a, state.b);
1999
+ state.a = 0;
2000
+ CLOSURE_DTORS.unregister(state);
2001
+ }
2002
+ };
2003
+ CLOSURE_DTORS.register(real, state, state);
2004
+ return real;
2005
+ }
2147
2006
 
2148
- export function __wbg_then_429f7caf1026411d(arg0, arg1, arg2) {
2149
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2150
- return addHeapObject(ret);
2151
- };
2007
+ function passArrayJsValueToWasm0(array, malloc) {
2008
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2009
+ const mem = getDataViewMemory0();
2010
+ for (let i = 0; i < array.length; i++) {
2011
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
2012
+ }
2013
+ WASM_VECTOR_LEN = array.length;
2014
+ return ptr;
2015
+ }
2152
2016
 
2153
- export function __wbg_then_4f95312d68691235(arg0, arg1) {
2154
- const ret = getObject(arg0).then(getObject(arg1));
2155
- return addHeapObject(ret);
2156
- };
2017
+ function passStringToWasm0(arg, malloc, realloc) {
2018
+ if (realloc === undefined) {
2019
+ const buf = cachedTextEncoder.encode(arg);
2020
+ const ptr = malloc(buf.length, 1) >>> 0;
2021
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2022
+ WASM_VECTOR_LEN = buf.length;
2023
+ return ptr;
2024
+ }
2157
2025
 
2158
- export function __wbg_url_b6d11838a4f95198(arg0, arg1) {
2159
- const ret = getObject(arg1).url;
2160
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2161
- const len1 = WASM_VECTOR_LEN;
2162
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2163
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2164
- };
2026
+ let len = arg.length;
2027
+ let ptr = malloc(len, 1) >>> 0;
2165
2028
 
2166
- export function __wbg_userAgent_e18bc0cc9ad38ec1() { return handleError(function (arg0, arg1) {
2167
- const ret = getObject(arg1).userAgent;
2168
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2169
- const len1 = WASM_VECTOR_LEN;
2170
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2171
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2172
- }, arguments) };
2029
+ const mem = getUint8ArrayMemory0();
2173
2030
 
2174
- export function __wbg_value_57b7b035e117f7ee(arg0) {
2175
- const ret = getObject(arg0).value;
2176
- return addHeapObject(ret);
2177
- };
2031
+ let offset = 0;
2178
2032
 
2179
- export function __wbg_versions_c01dfd4722a88165(arg0) {
2180
- const ret = getObject(arg0).versions;
2181
- return addHeapObject(ret);
2182
- };
2033
+ for (; offset < len; offset++) {
2034
+ const code = arg.charCodeAt(offset);
2035
+ if (code > 0x7F) break;
2036
+ mem[ptr + offset] = code;
2037
+ }
2038
+ if (offset !== len) {
2039
+ if (offset !== 0) {
2040
+ arg = arg.slice(offset);
2041
+ }
2042
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2043
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2044
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2183
2045
 
2184
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
2185
- // Cast intrinsic for `Ref(String) -> Externref`.
2186
- const ret = getStringFromWasm0(arg0, arg1);
2187
- return addHeapObject(ret);
2188
- };
2046
+ offset += ret.written;
2047
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2048
+ }
2189
2049
 
2190
- export function __wbindgen_cast_4082834687a71a5d(arg0, arg1) {
2191
- // 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`.
2192
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_235, __wasm_bindgen_func_elem_3270);
2193
- return addHeapObject(ret);
2194
- };
2050
+ WASM_VECTOR_LEN = offset;
2051
+ return ptr;
2052
+ }
2195
2053
 
2196
- export function __wbindgen_cast_41f8c1f01ac9df12(arg0, arg1) {
2197
- // Cast intrinsic for `Closure(Closure { dtor_idx: 965, function: Function { arguments: [], shim_idx: 966, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2198
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8617, __wasm_bindgen_func_elem_8626);
2199
- return addHeapObject(ret);
2200
- };
2054
+ function takeObject(idx) {
2055
+ const ret = getObject(idx);
2056
+ dropObject(idx);
2057
+ return ret;
2058
+ }
2201
2059
 
2202
- export function __wbindgen_cast_4892f1fb8f346ce7(arg0, arg1) {
2203
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1000, function: Function { arguments: [Externref], shim_idx: 1001, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2204
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8761, __wasm_bindgen_func_elem_8776);
2205
- return addHeapObject(ret);
2206
- };
2060
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2061
+ cachedTextDecoder.decode();
2062
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
2063
+ let numBytesDecoded = 0;
2064
+ function decodeText(ptr, len) {
2065
+ numBytesDecoded += len;
2066
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2067
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2068
+ cachedTextDecoder.decode();
2069
+ numBytesDecoded = len;
2070
+ }
2071
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2072
+ }
2207
2073
 
2208
- export function __wbindgen_cast_9ae0607507abb057(arg0) {
2209
- // Cast intrinsic for `I64 -> Externref`.
2210
- const ret = arg0;
2211
- return addHeapObject(ret);
2212
- };
2074
+ const cachedTextEncoder = new TextEncoder();
2213
2075
 
2214
- export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
2215
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
2216
- const ret = getArrayU8FromWasm0(arg0, arg1);
2217
- return addHeapObject(ret);
2218
- };
2076
+ if (!('encodeInto' in cachedTextEncoder)) {
2077
+ cachedTextEncoder.encodeInto = function (arg, view) {
2078
+ const buf = cachedTextEncoder.encode(arg);
2079
+ view.set(buf);
2080
+ return {
2081
+ read: arg.length,
2082
+ written: buf.length
2083
+ };
2084
+ };
2085
+ }
2219
2086
 
2220
- export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
2221
- // Cast intrinsic for `F64 -> Externref`.
2222
- const ret = arg0;
2223
- return addHeapObject(ret);
2224
- };
2087
+ let WASM_VECTOR_LEN = 0;
2225
2088
 
2226
- export function __wbindgen_object_clone_ref(arg0) {
2227
- const ret = getObject(arg0);
2228
- return addHeapObject(ret);
2229
- };
2230
2089
 
2231
- export function __wbindgen_object_drop_ref(arg0) {
2232
- takeObject(arg0);
2233
- };
2090
+ let wasm;
2091
+ export function __wbg_set_wasm(val) {
2092
+ wasm = val;
2093
+ }