@cartridge/controller-wasm 0.7.14-0df5a4c → 0.7.14-3b036eb

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.
Binary file
@@ -1,25 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export interface JsCall {
4
- contractAddress: JsFelt;
5
- entrypoint: string;
6
- calldata: JsFelt[];
7
- }
8
-
9
- export type JsPriceUnit = "WEI" | "FRI";
10
-
11
- export interface JsEstimateFeeDetails {
12
- nonce: JsFelt;
13
- }
14
-
15
- export interface JsFeeEstimate {
16
- l1_gas_consumed: number;
17
- l1_gas_price: number;
18
- l2_gas_consumed: number;
19
- l2_gas_price: number;
20
- l1_data_gas_consumed: number;
21
- l1_data_gas_price: number;
22
- overall_fee: number;
3
+ /**
4
+ * Result type for signExecuteFromOutside containing both the OutsideExecution and signature
5
+ */
6
+ export interface JsSignedOutsideExecution {
7
+ outside_execution: JsOutsideExecutionV3;
8
+ signature: JsFelt[];
23
9
  }
24
10
 
25
11
  /**
@@ -33,12 +19,16 @@ export interface JsOutsideExecutionV3 {
33
19
  nonce: [JsFelt, JsFelt];
34
20
  }
35
21
 
36
- /**
37
- * Result type for signExecuteFromOutside containing both the OutsideExecution and signature
38
- */
39
- export interface JsSignedOutsideExecution {
40
- outside_execution: JsOutsideExecutionV3;
41
- signature: JsFelt[];
22
+ export type JsFelt = Felt;
23
+
24
+ export type JsFeeSource = "PAYMASTER" | "CREDITS";
25
+
26
+ export type Felts = JsFelt[];
27
+
28
+ export interface JsCall {
29
+ contractAddress: JsFelt;
30
+ entrypoint: string;
31
+ calldata: JsFelt[];
42
32
  }
43
33
 
44
34
  export interface Owner {
@@ -57,32 +47,18 @@ export interface TypedDataPolicy {
57
47
  authorized?: boolean;
58
48
  }
59
49
 
50
+ export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
51
+
60
52
  export interface ApprovalPolicy {
61
53
  target: JsFelt;
62
54
  spender: JsFelt;
63
55
  amount: JsFelt;
64
56
  }
65
57
 
66
- export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
67
-
68
- export type JsRegister = RegisterInput;
69
-
70
- export type JsRegisterResponse = ResponseData;
71
-
72
- export interface WebauthnSigner {
73
- rpId: string;
74
- credentialId: string;
75
- publicKey: string;
76
- }
77
-
78
58
  export interface StarknetSigner {
79
59
  privateKey: JsFelt;
80
60
  }
81
61
 
82
- export interface Eip191Signer {
83
- address: string;
84
- }
85
-
86
62
  export interface Signer {
87
63
  webauthns?: WebauthnSigner[];
88
64
  webauthn?: WebauthnSigner;
@@ -92,18 +68,20 @@ export interface Signer {
92
68
 
93
69
  export type JsAddSignerInput = SignerInput;
94
70
 
95
- export type JsRemoveSignerInput = SignerInput;
96
-
97
- export type JsFelt = Felt;
71
+ export interface Eip191Signer {
72
+ address: string;
73
+ }
98
74
 
99
- export type Felts = JsFelt[];
75
+ export interface WebauthnSigner {
76
+ rpId: string;
77
+ credentialId: string;
78
+ publicKey: string;
79
+ }
100
80
 
101
- export type JsFeeSource = "PAYMASTER" | "CREDITS";
81
+ export type JsRemoveSignerInput = SignerInput;
102
82
 
103
83
  export type JsSubscribeSessionResult = SubscribeCreateSessionSubscribeCreateSession;
104
84
 
105
- export type JsRevokableSession = RevokableSession;
106
-
107
85
  export interface AuthorizedSession {
108
86
  session: Session;
109
87
  authorization: JsFelt[] | null;
@@ -128,16 +106,38 @@ export interface Credentials {
128
106
  privateKey: JsFelt;
129
107
  }
130
108
 
109
+ export type JsRevokableSession = RevokableSession;
110
+
111
+ export type JsPriceUnit = "WEI" | "FRI";
112
+
113
+ export interface JsEstimateFeeDetails {
114
+ nonce: JsFelt;
115
+ }
116
+
117
+ export interface JsFeeEstimate {
118
+ l1_gas_consumed: number;
119
+ l1_gas_price: number;
120
+ l2_gas_consumed: number;
121
+ l2_gas_price: number;
122
+ l1_data_gas_consumed: number;
123
+ l1_data_gas_price: number;
124
+ overall_fee: number;
125
+ }
126
+
127
+ export type JsRegister = RegisterInput;
128
+
129
+ export type JsRegisterResponse = ResponseData;
130
+
131
131
 
132
132
  export class CartridgeSessionAccount {
133
133
  private constructor();
134
134
  free(): void;
135
135
  [Symbol.dispose](): void;
136
- static new(rpc_url: string, signer: JsFelt, address: JsFelt, chain_id: JsFelt, session_authorization: JsFelt[], session: Session): CartridgeSessionAccount;
137
136
  static newAsRegistered(rpc_url: string, signer: JsFelt, address: JsFelt, owner_guid: JsFelt, chain_id: JsFelt, session: Session): CartridgeSessionAccount;
137
+ executeFromOutside(calls: JsCall[]): Promise<any>;
138
+ static new(rpc_url: string, signer: JsFelt, address: JsFelt, chain_id: JsFelt, session_authorization: JsFelt[], session: Session): CartridgeSessionAccount;
138
139
  sign(hash: JsFelt, calls: JsCall[]): Promise<Felts>;
139
140
  execute(calls: JsCall[]): Promise<any>;
140
- executeFromOutside(calls: JsCall[]): Promise<any>;
141
141
  }
142
142
 
143
143
  export enum ErrorCode {
@@ -244,16 +244,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
244
244
 
245
245
  let WASM_VECTOR_LEN = 0;
246
246
 
247
- function __wasm_bindgen_func_elem_3935(arg0, arg1) {
248
- wasm.__wasm_bindgen_func_elem_3935(arg0, arg1);
247
+ function __wasm_bindgen_func_elem_3880(arg0, arg1) {
248
+ wasm.__wasm_bindgen_func_elem_3880(arg0, arg1);
249
249
  }
250
250
 
251
- function __wasm_bindgen_func_elem_4078(arg0, arg1, arg2) {
252
- wasm.__wasm_bindgen_func_elem_4078(arg0, arg1, addHeapObject(arg2));
251
+ function __wasm_bindgen_func_elem_4025(arg0, arg1, arg2) {
252
+ wasm.__wasm_bindgen_func_elem_4025(arg0, arg1, addHeapObject(arg2));
253
253
  }
254
254
 
255
- function __wasm_bindgen_func_elem_5869(arg0, arg1, arg2, arg3) {
256
- wasm.__wasm_bindgen_func_elem_5869(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
255
+ function __wasm_bindgen_func_elem_5813(arg0, arg1, arg2, arg3) {
256
+ wasm.__wasm_bindgen_func_elem_5813(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
257
257
  }
258
258
 
259
259
  const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
@@ -292,19 +292,17 @@ export class CartridgeSessionAccount {
292
292
  * @param {string} rpc_url
293
293
  * @param {JsFelt} signer
294
294
  * @param {JsFelt} address
295
+ * @param {JsFelt} owner_guid
295
296
  * @param {JsFelt} chain_id
296
- * @param {JsFelt[]} session_authorization
297
297
  * @param {Session} session
298
298
  * @returns {CartridgeSessionAccount}
299
299
  */
300
- static new(rpc_url, signer, address, chain_id, session_authorization, session) {
300
+ static newAsRegistered(rpc_url, signer, address, owner_guid, chain_id, session) {
301
301
  try {
302
302
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
303
303
  const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
304
304
  const len0 = WASM_VECTOR_LEN;
305
- const ptr1 = passArrayJsValueToWasm0(session_authorization, wasm.__wbindgen_export);
306
- const len1 = WASM_VECTOR_LEN;
307
- wasm.cartridgesessionaccount_new(retptr, ptr0, len0, addHeapObject(signer), addHeapObject(address), addHeapObject(chain_id), ptr1, len1, addHeapObject(session));
305
+ wasm.cartridgesessionaccount_newAsRegistered(retptr, ptr0, len0, addHeapObject(signer), addHeapObject(address), addHeapObject(owner_guid), addHeapObject(chain_id), addHeapObject(session));
308
306
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
309
307
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
310
308
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -316,21 +314,33 @@ export class CartridgeSessionAccount {
316
314
  wasm.__wbindgen_add_to_stack_pointer(16);
317
315
  }
318
316
  }
317
+ /**
318
+ * @param {JsCall[]} calls
319
+ * @returns {Promise<any>}
320
+ */
321
+ executeFromOutside(calls) {
322
+ const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
323
+ const len0 = WASM_VECTOR_LEN;
324
+ const ret = wasm.cartridgesessionaccount_executeFromOutside(this.__wbg_ptr, ptr0, len0);
325
+ return takeObject(ret);
326
+ }
319
327
  /**
320
328
  * @param {string} rpc_url
321
329
  * @param {JsFelt} signer
322
330
  * @param {JsFelt} address
323
- * @param {JsFelt} owner_guid
324
331
  * @param {JsFelt} chain_id
332
+ * @param {JsFelt[]} session_authorization
325
333
  * @param {Session} session
326
334
  * @returns {CartridgeSessionAccount}
327
335
  */
328
- static newAsRegistered(rpc_url, signer, address, owner_guid, chain_id, session) {
336
+ static new(rpc_url, signer, address, chain_id, session_authorization, session) {
329
337
  try {
330
338
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
331
339
  const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
332
340
  const len0 = WASM_VECTOR_LEN;
333
- wasm.cartridgesessionaccount_newAsRegistered(retptr, ptr0, len0, addHeapObject(signer), addHeapObject(address), addHeapObject(owner_guid), addHeapObject(chain_id), addHeapObject(session));
341
+ const ptr1 = passArrayJsValueToWasm0(session_authorization, wasm.__wbindgen_export);
342
+ const len1 = WASM_VECTOR_LEN;
343
+ wasm.cartridgesessionaccount_new(retptr, ptr0, len0, addHeapObject(signer), addHeapObject(address), addHeapObject(chain_id), ptr1, len1, addHeapObject(session));
334
344
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
335
345
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
336
346
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -363,16 +373,6 @@ export class CartridgeSessionAccount {
363
373
  const ret = wasm.cartridgesessionaccount_execute(this.__wbg_ptr, ptr0, len0);
364
374
  return takeObject(ret);
365
375
  }
366
- /**
367
- * @param {JsCall[]} calls
368
- * @returns {Promise<any>}
369
- */
370
- executeFromOutside(calls) {
371
- const ptr0 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
372
- const len0 = WASM_VECTOR_LEN;
373
- const ret = wasm.cartridgesessionaccount_executeFromOutside(this.__wbg_ptr, ptr0, len0);
374
- return takeObject(ret);
375
- }
376
376
  }
377
377
  if (Symbol.dispose) CartridgeSessionAccount.prototype[Symbol.dispose] = CartridgeSessionAccount.prototype.free;
378
378
 
@@ -687,7 +687,7 @@ export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg
687
687
  return addHeapObject(ret);
688
688
  }, arguments) };
689
689
 
690
- export function __wbg_clearTimeout_b716ecb44bea14ed(arg0) {
690
+ export function __wbg_clearTimeout_42d9ccd50822fd3a(arg0) {
691
691
  const ret = clearTimeout(takeObject(arg0));
692
692
  return addHeapObject(ret);
693
693
  };
@@ -707,7 +707,7 @@ export function __wbg_done_62ea16af4ce34b24(arg0) {
707
707
  return ret;
708
708
  };
709
709
 
710
- export function __wbg_fetch_7fb7602a1bf647ec(arg0) {
710
+ export function __wbg_fetch_6bbc32f991730587(arg0) {
711
711
  const ret = fetch(getObject(arg0));
712
712
  return addHeapObject(ret);
713
713
  };
@@ -892,7 +892,7 @@ export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
892
892
  const a = state0.a;
893
893
  state0.a = 0;
894
894
  try {
895
- return __wasm_bindgen_func_elem_5869(a, state0.b, arg0, arg1);
895
+ return __wasm_bindgen_func_elem_5813(a, state0.b, arg0, arg1);
896
896
  } finally {
897
897
  state0.a = a;
898
898
  }
@@ -1002,7 +1002,7 @@ export function __wbg_resolve_fd5bfbaa4ce36e1e(arg0) {
1002
1002
  return addHeapObject(ret);
1003
1003
  };
1004
1004
 
1005
- export function __wbg_setTimeout_4302406184dcc5be(arg0, arg1) {
1005
+ export function __wbg_setTimeout_4ec014681668a581(arg0, arg1) {
1006
1006
  const ret = setTimeout(getObject(arg0), arg1);
1007
1007
  return addHeapObject(ret);
1008
1008
  };
@@ -1151,21 +1151,21 @@ export function __wbg_versions_c01dfd4722a88165(arg0) {
1151
1151
  return addHeapObject(ret);
1152
1152
  };
1153
1153
 
1154
- export function __wbindgen_cast_07a7cf3b22b8fd7a(arg0, arg1) {
1155
- // Cast intrinsic for `Closure(Closure { dtor_idx: 457, function: Function { arguments: [], shim_idx: 458, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1156
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3926, __wasm_bindgen_func_elem_3935);
1157
- return addHeapObject(ret);
1158
- };
1159
-
1160
1154
  export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
1161
1155
  // Cast intrinsic for `Ref(String) -> Externref`.
1162
1156
  const ret = getStringFromWasm0(arg0, arg1);
1163
1157
  return addHeapObject(ret);
1164
1158
  };
1165
1159
 
1166
- export function __wbindgen_cast_4b1c6ecbf5b749c2(arg0, arg1) {
1167
- // Cast intrinsic for `Closure(Closure { dtor_idx: 490, function: Function { arguments: [Externref], shim_idx: 491, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1168
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4063, __wasm_bindgen_func_elem_4078);
1160
+ export function __wbindgen_cast_5878cfe9fa9dbe2e(arg0, arg1) {
1161
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 495, function: Function { arguments: [Externref], shim_idx: 496, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1162
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4010, __wasm_bindgen_func_elem_4025);
1163
+ return addHeapObject(ret);
1164
+ };
1165
+
1166
+ export function __wbindgen_cast_c006400c7b517809(arg0, arg1) {
1167
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 460, function: Function { arguments: [], shim_idx: 461, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1168
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3871, __wasm_bindgen_func_elem_3880);
1169
1169
  return addHeapObject(ret);
1170
1170
  };
1171
1171
 
Binary file