@cartridge/controller-wasm 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartridge/controller-wasm",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Wasm bindings for Cartridge Controller and Session Account",
5
5
  "type": "module",
6
6
  "main": "./pkg-controller/account_wasm.js",
@@ -117,6 +117,10 @@ export interface TypedDataPolicy {
117
117
 
118
118
  export type Policy = CallPolicy | TypedDataPolicy;
119
119
 
120
+ export type JsRegister = RegisterInput;
121
+
122
+ export type JsRegisterResponse = ResponseData;
123
+
120
124
  export interface WebauthnSigner {
121
125
  rpId: string;
122
126
  credentialId: string;
@@ -190,6 +194,7 @@ export class CartridgeAccount {
190
194
  registerSessionCalldata(policies: Policy[], expires_at: bigint, public_key: JsFelt): Promise<any>;
191
195
  upgrade(new_class_hash: JsFelt): Promise<JsCall>;
192
196
  login(expires_at: bigint, is_controller_registered?: boolean | null): Promise<AuthorizedSession>;
197
+ register(register: JsRegister): Promise<JsRegisterResponse>;
193
198
  createSession(policies: Policy[], expires_at: bigint): Promise<AuthorizedSession | undefined>;
194
199
  skipSession(policies: Policy[]): Promise<void>;
195
200
  estimateInvokeFee(calls: JsCall[]): Promise<JsFeeEstimate>;
@@ -276,7 +276,7 @@ function __wbg_adapter_42(arg0, arg1, arg2) {
276
276
  wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
277
277
  }
278
278
 
279
- function __wbg_adapter_227(arg0, arg1, arg2, arg3) {
279
+ function __wbg_adapter_230(arg0, arg1, arg2, arg3) {
280
280
  wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
281
281
  }
282
282
 
@@ -493,6 +493,14 @@ export class CartridgeAccount {
493
493
  const ret = wasm.cartridgeaccount_login(this.__wbg_ptr, expires_at, isLikeNone(is_controller_registered) ? 0xFFFFFF : is_controller_registered ? 1 : 0);
494
494
  return takeObject(ret);
495
495
  }
496
+ /**
497
+ * @param {JsRegister} register
498
+ * @returns {Promise<JsRegisterResponse>}
499
+ */
500
+ register(register) {
501
+ const ret = wasm.cartridgeaccount_register(this.__wbg_ptr, addHeapObject(register));
502
+ return takeObject(ret);
503
+ }
496
504
  /**
497
505
  * @param {Policy[]} policies
498
506
  * @param {bigint} expires_at
@@ -1015,6 +1023,10 @@ export function __wbg_done_769e5ede4b31c67b(arg0) {
1015
1023
  return ret;
1016
1024
  };
1017
1025
 
1026
+ export function __wbg_error_524f506f44df1645(arg0) {
1027
+ console.error(getObject(arg0));
1028
+ };
1029
+
1018
1030
  export function __wbg_fetch_509096533071c657(arg0, arg1) {
1019
1031
  const ret = getObject(arg0).fetch(getObject(arg1));
1020
1032
  return addHeapObject(ret);
@@ -1183,7 +1195,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
1183
1195
  const a = state0.a;
1184
1196
  state0.a = 0;
1185
1197
  try {
1186
- return __wbg_adapter_227(a, state0.b, arg0, arg1);
1198
+ return __wbg_adapter_230(a, state0.b, arg0, arg1);
1187
1199
  } finally {
1188
1200
  state0.a = a;
1189
1201
  }
@@ -1461,8 +1473,8 @@ export function __wbindgen_cb_drop(arg0) {
1461
1473
  return ret;
1462
1474
  };
1463
1475
 
1464
- export function __wbindgen_closure_wrapper4334(arg0, arg1, arg2) {
1465
- const ret = makeMutClosure(arg0, arg1, 524, __wbg_adapter_42);
1476
+ export function __wbindgen_closure_wrapper4532(arg0, arg1, arg2) {
1477
+ const ret = makeMutClosure(arg0, arg1, 534, __wbg_adapter_42);
1466
1478
  return addHeapObject(ret);
1467
1479
  };
1468
1480
 
Binary file
@@ -103,6 +103,10 @@ export interface TypedDataPolicy {
103
103
 
104
104
  export type Policy = CallPolicy | TypedDataPolicy;
105
105
 
106
+ export type JsRegister = RegisterInput;
107
+
108
+ export type JsRegisterResponse = ResponseData;
109
+
106
110
  export interface WebauthnSigner {
107
111
  rpId: string;
108
112
  credentialId: string;
@@ -1001,8 +1001,8 @@ export function __wbindgen_cb_drop(arg0) {
1001
1001
  return ret;
1002
1002
  };
1003
1003
 
1004
- export function __wbindgen_closure_wrapper2578(arg0, arg1, arg2) {
1005
- const ret = makeMutClosure(arg0, arg1, 311, __wbg_adapter_42);
1004
+ export function __wbindgen_closure_wrapper2570(arg0, arg1, arg2) {
1005
+ const ret = makeMutClosure(arg0, arg1, 306, __wbg_adapter_42);
1006
1006
  return addHeapObject(ret);
1007
1007
  };
1008
1008
 
Binary file