@cartridge/controller-wasm 0.3.1 → 0.3.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.
package/package.json
CHANGED
|
@@ -281,8 +281,12 @@ export class CartridgeAccountWithMeta {
|
|
|
281
281
|
export class ControllerFactory {
|
|
282
282
|
private constructor();
|
|
283
283
|
free(): void;
|
|
284
|
-
static
|
|
284
|
+
static fromStorage(app_id: string, cartridge_api_url: string): CartridgeAccountWithMeta | undefined;
|
|
285
285
|
static login(app_id: string, username: string, class_hash: JsFelt, rpc_url: string, chain_id: JsFelt, address: JsFelt, owner: Owner, cartridge_api_url: string, session_expires_at_s: bigint, is_controller_registered?: boolean | null): Promise<LoginResult>;
|
|
286
|
+
/**
|
|
287
|
+
* This should only be used with webauthn signers
|
|
288
|
+
*/
|
|
289
|
+
static apiLogin(app_id: string, username: string, class_hash: JsFelt, rpc_url: string, chain_id: JsFelt, address: JsFelt, owner: Owner, cartridge_api_url: string): Promise<CartridgeAccountWithMeta>;
|
|
286
290
|
}
|
|
287
291
|
export class JsControllerError {
|
|
288
292
|
private constructor();
|
|
@@ -315,7 +315,7 @@ function __wbg_adapter_50(arg0, arg1, arg2) {
|
|
|
315
315
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
function
|
|
318
|
+
function __wbg_adapter_287(arg0, arg1, arg2, arg3) {
|
|
319
319
|
wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
320
320
|
}
|
|
321
321
|
|
|
@@ -1014,7 +1014,7 @@ export class ControllerFactory {
|
|
|
1014
1014
|
* @param {string} cartridge_api_url
|
|
1015
1015
|
* @returns {CartridgeAccountWithMeta | undefined}
|
|
1016
1016
|
*/
|
|
1017
|
-
static
|
|
1017
|
+
static fromStorage(app_id, cartridge_api_url) {
|
|
1018
1018
|
try {
|
|
1019
1019
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1020
1020
|
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -1058,6 +1058,30 @@ export class ControllerFactory {
|
|
|
1058
1058
|
const ret = wasm.controllerfactory_login(ptr0, len0, ptr1, len1, addHeapObject(class_hash), ptr2, len2, addHeapObject(chain_id), addHeapObject(address), addHeapObject(owner), ptr3, len3, session_expires_at_s, isLikeNone(is_controller_registered) ? 0xFFFFFF : is_controller_registered ? 1 : 0);
|
|
1059
1059
|
return takeObject(ret);
|
|
1060
1060
|
}
|
|
1061
|
+
/**
|
|
1062
|
+
* This should only be used with webauthn signers
|
|
1063
|
+
* @param {string} app_id
|
|
1064
|
+
* @param {string} username
|
|
1065
|
+
* @param {JsFelt} class_hash
|
|
1066
|
+
* @param {string} rpc_url
|
|
1067
|
+
* @param {JsFelt} chain_id
|
|
1068
|
+
* @param {JsFelt} address
|
|
1069
|
+
* @param {Owner} owner
|
|
1070
|
+
* @param {string} cartridge_api_url
|
|
1071
|
+
* @returns {Promise<CartridgeAccountWithMeta>}
|
|
1072
|
+
*/
|
|
1073
|
+
static apiLogin(app_id, username, class_hash, rpc_url, chain_id, address, owner, cartridge_api_url) {
|
|
1074
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1075
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1076
|
+
const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1077
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1078
|
+
const ptr2 = passStringToWasm0(rpc_url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1079
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1080
|
+
const ptr3 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1081
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1082
|
+
const ret = wasm.controllerfactory_apiLogin(ptr0, len0, ptr1, len1, addHeapObject(class_hash), ptr2, len2, addHeapObject(chain_id), addHeapObject(address), addHeapObject(owner), ptr3, len3);
|
|
1083
|
+
return takeObject(ret);
|
|
1084
|
+
}
|
|
1061
1085
|
}
|
|
1062
1086
|
|
|
1063
1087
|
const JsControllerErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1465,7 +1489,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
1465
1489
|
const a = state0.a;
|
|
1466
1490
|
state0.a = 0;
|
|
1467
1491
|
try {
|
|
1468
|
-
return
|
|
1492
|
+
return __wbg_adapter_287(a, state0.b, arg0, arg1);
|
|
1469
1493
|
} finally {
|
|
1470
1494
|
state0.a = a;
|
|
1471
1495
|
}
|
|
@@ -1807,18 +1831,18 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
1807
1831
|
return ret;
|
|
1808
1832
|
};
|
|
1809
1833
|
|
|
1810
|
-
export function
|
|
1834
|
+
export function __wbindgen_closure_wrapper2599(arg0, arg1, arg2) {
|
|
1811
1835
|
const ret = makeClosure(arg0, arg1, 33, __wbg_adapter_44);
|
|
1812
1836
|
return addHeapObject(ret);
|
|
1813
1837
|
};
|
|
1814
1838
|
|
|
1815
|
-
export function
|
|
1816
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1839
|
+
export function __wbindgen_closure_wrapper8287(arg0, arg1, arg2) {
|
|
1840
|
+
const ret = makeMutClosure(arg0, arg1, 880, __wbg_adapter_47);
|
|
1817
1841
|
return addHeapObject(ret);
|
|
1818
1842
|
};
|
|
1819
1843
|
|
|
1820
|
-
export function
|
|
1821
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1844
|
+
export function __wbindgen_closure_wrapper8436(arg0, arg1, arg2) {
|
|
1845
|
+
const ret = makeMutClosure(arg0, arg1, 914, __wbg_adapter_50);
|
|
1822
1846
|
return addHeapObject(ret);
|
|
1823
1847
|
};
|
|
1824
1848
|
|
|
Binary file
|
|
@@ -1035,13 +1035,13 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
1035
1035
|
return ret;
|
|
1036
1036
|
};
|
|
1037
1037
|
|
|
1038
|
-
export function
|
|
1039
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1038
|
+
export function __wbindgen_closure_wrapper3368(arg0, arg1, arg2) {
|
|
1039
|
+
const ret = makeMutClosure(arg0, arg1, 402, __wbg_adapter_42);
|
|
1040
1040
|
return addHeapObject(ret);
|
|
1041
1041
|
};
|
|
1042
1042
|
|
|
1043
|
-
export function
|
|
1044
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1043
|
+
export function __wbindgen_closure_wrapper3504(arg0, arg1, arg2) {
|
|
1044
|
+
const ret = makeMutClosure(arg0, arg1, 437, __wbg_adapter_45);
|
|
1045
1045
|
return addHeapObject(ret);
|
|
1046
1046
|
};
|
|
1047
1047
|
|
|
Binary file
|