@cartridge/controller-wasm 0.7.14-0df5a4c → 0.7.14-3a84802
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 +1 -1
- package/pkg-controller/account_wasm.d.ts +98 -98
- package/pkg-controller/account_wasm_bg.js +292 -292
- package/pkg-controller/account_wasm_bg.wasm +0 -0
- package/pkg-session/session_wasm.d.ts +63 -63
- package/pkg-session/session_wasm_bg.js +37 -37
- package/pkg-session/session_wasm_bg.wasm +0 -0
|
Binary file
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 {
|
|
@@ -46,16 +36,18 @@ export interface Owner {
|
|
|
46
36
|
account?: JsFelt;
|
|
47
37
|
}
|
|
48
38
|
|
|
39
|
+
export interface TypedDataPolicy {
|
|
40
|
+
scope_hash: JsFelt;
|
|
41
|
+
authorized?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
49
44
|
export interface CallPolicy {
|
|
50
45
|
target: JsFelt;
|
|
51
46
|
method: JsFelt;
|
|
52
47
|
authorized?: boolean;
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
export
|
|
56
|
-
scope_hash: JsFelt;
|
|
57
|
-
authorized?: boolean;
|
|
58
|
-
}
|
|
50
|
+
export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
|
|
59
51
|
|
|
60
52
|
export interface ApprovalPolicy {
|
|
61
53
|
target: JsFelt;
|
|
@@ -63,11 +55,20 @@ export interface ApprovalPolicy {
|
|
|
63
55
|
amount: JsFelt;
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
export
|
|
58
|
+
export interface Signer {
|
|
59
|
+
webauthns?: WebauthnSigner[];
|
|
60
|
+
webauthn?: WebauthnSigner;
|
|
61
|
+
starknet?: StarknetSigner;
|
|
62
|
+
eip191?: Eip191Signer;
|
|
63
|
+
}
|
|
67
64
|
|
|
68
|
-
export type
|
|
65
|
+
export type JsRemoveSignerInput = SignerInput;
|
|
69
66
|
|
|
70
|
-
export type
|
|
67
|
+
export type JsAddSignerInput = SignerInput;
|
|
68
|
+
|
|
69
|
+
export interface Eip191Signer {
|
|
70
|
+
address: string;
|
|
71
|
+
}
|
|
71
72
|
|
|
72
73
|
export interface WebauthnSigner {
|
|
73
74
|
rpId: string;
|
|
@@ -79,31 +80,23 @@ export interface StarknetSigner {
|
|
|
79
80
|
privateKey: JsFelt;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
export
|
|
83
|
-
address: string;
|
|
84
|
-
}
|
|
83
|
+
export type JsRevokableSession = RevokableSession;
|
|
85
84
|
|
|
86
|
-
export interface
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
export interface Session {
|
|
86
|
+
policies: Policy[];
|
|
87
|
+
expiresAt: number;
|
|
88
|
+
metadataHash: JsFelt;
|
|
89
|
+
sessionKeyGuid: JsFelt;
|
|
90
|
+
guardianKeyGuid: JsFelt;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
export
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export type JsFelt = Felt;
|
|
98
|
-
|
|
99
|
-
export type Felts = JsFelt[];
|
|
100
|
-
|
|
101
|
-
export type JsFeeSource = "PAYMASTER" | "CREDITS";
|
|
93
|
+
export interface Credentials {
|
|
94
|
+
authorization: JsFelt[];
|
|
95
|
+
privateKey: JsFelt;
|
|
96
|
+
}
|
|
102
97
|
|
|
103
98
|
export type JsSubscribeSessionResult = SubscribeCreateSessionSubscribeCreateSession;
|
|
104
99
|
|
|
105
|
-
export type JsRevokableSession = RevokableSession;
|
|
106
|
-
|
|
107
100
|
export interface AuthorizedSession {
|
|
108
101
|
session: Session;
|
|
109
102
|
authorization: JsFelt[] | null;
|
|
@@ -115,29 +108,36 @@ export interface AuthorizedSession {
|
|
|
115
108
|
guardianKeyGuid: JsFelt;
|
|
116
109
|
}
|
|
117
110
|
|
|
118
|
-
export interface
|
|
119
|
-
|
|
120
|
-
expiresAt: number;
|
|
121
|
-
metadataHash: JsFelt;
|
|
122
|
-
sessionKeyGuid: JsFelt;
|
|
123
|
-
guardianKeyGuid: JsFelt;
|
|
111
|
+
export interface JsEstimateFeeDetails {
|
|
112
|
+
nonce: JsFelt;
|
|
124
113
|
}
|
|
125
114
|
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
|
|
115
|
+
export type JsPriceUnit = "WEI" | "FRI";
|
|
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;
|
|
129
125
|
}
|
|
130
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
|
|
248
|
-
wasm.
|
|
247
|
+
function __wasm_bindgen_func_elem_4023(arg0, arg1, arg2) {
|
|
248
|
+
wasm.__wasm_bindgen_func_elem_4023(arg0, arg1, addHeapObject(arg2));
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
function
|
|
252
|
-
wasm.
|
|
251
|
+
function __wasm_bindgen_func_elem_3878(arg0, arg1) {
|
|
252
|
+
wasm.__wasm_bindgen_func_elem_3878(arg0, arg1);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
function
|
|
256
|
-
wasm.
|
|
255
|
+
function __wasm_bindgen_func_elem_5806(arg0, arg1, arg2, arg3) {
|
|
256
|
+
wasm.__wasm_bindgen_func_elem_5806(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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
895
|
+
return __wasm_bindgen_func_elem_5806(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
|
|
1005
|
+
export function __wbg_setTimeout_4ec014681668a581(arg0, arg1) {
|
|
1006
1006
|
const ret = setTimeout(getObject(arg0), arg1);
|
|
1007
1007
|
return addHeapObject(ret);
|
|
1008
1008
|
};
|
|
@@ -1151,9 +1151,9 @@ export function __wbg_versions_c01dfd4722a88165(arg0) {
|
|
|
1151
1151
|
return addHeapObject(ret);
|
|
1152
1152
|
};
|
|
1153
1153
|
|
|
1154
|
-
export function
|
|
1155
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1156
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1154
|
+
export function __wbindgen_cast_012c9f0b783cb7f4(arg0, arg1) {
|
|
1155
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 500, function: Function { arguments: [Externref], shim_idx: 501, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1156
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4008, __wasm_bindgen_func_elem_4023);
|
|
1157
1157
|
return addHeapObject(ret);
|
|
1158
1158
|
};
|
|
1159
1159
|
|
|
@@ -1163,12 +1163,6 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
1163
1163
|
return addHeapObject(ret);
|
|
1164
1164
|
};
|
|
1165
1165
|
|
|
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);
|
|
1169
|
-
return addHeapObject(ret);
|
|
1170
|
-
};
|
|
1171
|
-
|
|
1172
1166
|
export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
|
|
1173
1167
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1174
1168
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
@@ -1181,6 +1175,12 @@ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
|
1181
1175
|
return addHeapObject(ret);
|
|
1182
1176
|
};
|
|
1183
1177
|
|
|
1178
|
+
export function __wbindgen_cast_e585a18257edad45(arg0, arg1) {
|
|
1179
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 465, function: Function { arguments: [], shim_idx: 466, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1180
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3869, __wasm_bindgen_func_elem_3878);
|
|
1181
|
+
return addHeapObject(ret);
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
1184
|
export function __wbindgen_object_clone_ref(arg0) {
|
|
1185
1185
|
const ret = getObject(arg0);
|
|
1186
1186
|
return addHeapObject(ret);
|
|
Binary file
|