@cartridge/controller-wasm 0.7.14-de92897 → 0.7.14-ef2704c
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 +96 -96
- package/pkg-controller/account_wasm_bg.js +289 -289
- package/pkg-controller/account_wasm_bg.wasm +0 -0
- package/pkg-session/session_wasm.d.ts +65 -65
- 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 Felts = JsFelt[];
|
|
25
|
+
|
|
26
|
+
export type JsFeeSource = "PAYMASTER" | "CREDITS";
|
|
27
|
+
|
|
28
|
+
export interface JsCall {
|
|
29
|
+
contractAddress: JsFelt;
|
|
30
|
+
entrypoint: string;
|
|
31
|
+
calldata: JsFelt[];
|
|
42
32
|
}
|
|
43
33
|
|
|
44
34
|
export interface Owner {
|
|
@@ -46,6 +36,14 @@ export interface Owner {
|
|
|
46
36
|
account?: JsFelt;
|
|
47
37
|
}
|
|
48
38
|
|
|
39
|
+
export interface ApprovalPolicy {
|
|
40
|
+
target: JsFelt;
|
|
41
|
+
spender: JsFelt;
|
|
42
|
+
amount: JsFelt;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
|
|
46
|
+
|
|
49
47
|
export interface CallPolicy {
|
|
50
48
|
target: JsFelt;
|
|
51
49
|
method: JsFelt;
|
|
@@ -57,17 +55,14 @@ export interface TypedDataPolicy {
|
|
|
57
55
|
authorized?: boolean;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
export
|
|
61
|
-
target: JsFelt;
|
|
62
|
-
spender: JsFelt;
|
|
63
|
-
amount: JsFelt;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
|
|
67
|
-
|
|
68
|
-
export type JsRegister = RegisterInput;
|
|
58
|
+
export type JsRemoveSignerInput = SignerInput;
|
|
69
59
|
|
|
70
|
-
export
|
|
60
|
+
export interface Signer {
|
|
61
|
+
webauthns?: WebauthnSigner[];
|
|
62
|
+
webauthn?: WebauthnSigner;
|
|
63
|
+
starknet?: StarknetSigner;
|
|
64
|
+
eip191?: Eip191Signer;
|
|
65
|
+
}
|
|
71
66
|
|
|
72
67
|
export interface WebauthnSigner {
|
|
73
68
|
rpId: string;
|
|
@@ -75,69 +70,74 @@ export interface WebauthnSigner {
|
|
|
75
70
|
publicKey: string;
|
|
76
71
|
}
|
|
77
72
|
|
|
78
|
-
export
|
|
79
|
-
privateKey: JsFelt;
|
|
80
|
-
}
|
|
73
|
+
export type JsAddSignerInput = SignerInput;
|
|
81
74
|
|
|
82
75
|
export interface Eip191Signer {
|
|
83
76
|
address: string;
|
|
84
77
|
}
|
|
85
78
|
|
|
86
|
-
export interface
|
|
87
|
-
|
|
88
|
-
webauthn?: WebauthnSigner;
|
|
89
|
-
starknet?: StarknetSigner;
|
|
90
|
-
eip191?: Eip191Signer;
|
|
79
|
+
export interface StarknetSigner {
|
|
80
|
+
privateKey: JsFelt;
|
|
91
81
|
}
|
|
92
82
|
|
|
93
|
-
export type JsAddSignerInput = SignerInput;
|
|
94
|
-
|
|
95
|
-
export type JsRemoveSignerInput = SignerInput;
|
|
96
|
-
|
|
97
|
-
export type JsFelt = Felt;
|
|
98
|
-
|
|
99
|
-
export type Felts = JsFelt[];
|
|
100
|
-
|
|
101
|
-
export type JsFeeSource = "PAYMASTER" | "CREDITS";
|
|
102
|
-
|
|
103
|
-
export type JsSubscribeSessionResult = SubscribeCreateSessionSubscribeCreateSession;
|
|
104
|
-
|
|
105
83
|
export type JsRevokableSession = RevokableSession;
|
|
106
84
|
|
|
107
|
-
export interface
|
|
108
|
-
|
|
109
|
-
authorization: JsFelt[] | null;
|
|
110
|
-
isRegistered: boolean;
|
|
85
|
+
export interface Session {
|
|
86
|
+
policies: Policy[];
|
|
111
87
|
expiresAt: number;
|
|
112
|
-
allowedPoliciesRoot: JsFelt;
|
|
113
88
|
metadataHash: JsFelt;
|
|
114
89
|
sessionKeyGuid: JsFelt;
|
|
115
90
|
guardianKeyGuid: JsFelt;
|
|
116
91
|
}
|
|
117
92
|
|
|
118
|
-
export interface
|
|
119
|
-
|
|
93
|
+
export interface AuthorizedSession {
|
|
94
|
+
session: Session;
|
|
95
|
+
authorization: JsFelt[] | null;
|
|
96
|
+
isRegistered: boolean;
|
|
120
97
|
expiresAt: number;
|
|
98
|
+
allowedPoliciesRoot: JsFelt;
|
|
121
99
|
metadataHash: JsFelt;
|
|
122
100
|
sessionKeyGuid: JsFelt;
|
|
123
101
|
guardianKeyGuid: JsFelt;
|
|
124
102
|
}
|
|
125
103
|
|
|
104
|
+
export type JsSubscribeSessionResult = SubscribeCreateSessionSubscribeCreateSession;
|
|
105
|
+
|
|
126
106
|
export interface Credentials {
|
|
127
107
|
authorization: JsFelt[];
|
|
128
108
|
privateKey: JsFelt;
|
|
129
109
|
}
|
|
130
110
|
|
|
111
|
+
export type JsPriceUnit = "WEI" | "FRI";
|
|
112
|
+
|
|
113
|
+
export interface JsFeeEstimate {
|
|
114
|
+
l1_gas_consumed: number;
|
|
115
|
+
l1_gas_price: number;
|
|
116
|
+
l2_gas_consumed: number;
|
|
117
|
+
l2_gas_price: number;
|
|
118
|
+
l1_data_gas_consumed: number;
|
|
119
|
+
l1_data_gas_price: number;
|
|
120
|
+
overall_fee: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface JsEstimateFeeDetails {
|
|
124
|
+
nonce: JsFelt;
|
|
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
|
|
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
|
|
|
@@ -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
|
}
|
|
@@ -1151,21 +1151,15 @@ export function __wbg_versions_c01dfd4722a88165(arg0) {
|
|
|
1151
1151
|
return addHeapObject(ret);
|
|
1152
1152
|
};
|
|
1153
1153
|
|
|
1154
|
-
export function
|
|
1155
|
-
// Cast intrinsic for `
|
|
1156
|
-
const ret =
|
|
1157
|
-
return addHeapObject(ret);
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
|
-
export function __wbindgen_cast_84b1c647b29b7771(arg0, arg1) {
|
|
1161
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 491, function: Function { arguments: [Externref], shim_idx: 492, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1162
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4058, __wasm_bindgen_func_elem_4073);
|
|
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);
|
|
1163
1157
|
return addHeapObject(ret);
|
|
1164
1158
|
};
|
|
1165
1159
|
|
|
1166
|
-
export function
|
|
1167
|
-
// Cast intrinsic for `
|
|
1168
|
-
const ret =
|
|
1160
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
1161
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1162
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1169
1163
|
return addHeapObject(ret);
|
|
1170
1164
|
};
|
|
1171
1165
|
|
|
@@ -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
|