@cartridge/controller-wasm 0.7.14-ef2704c → 0.7.14-efe4c2fe

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,13 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Result type for signExecuteFromOutside containing both the OutsideExecution and signature
5
- */
6
- export interface JsSignedOutsideExecution {
7
- outside_execution: JsOutsideExecutionV3;
8
- signature: JsFelt[];
9
- }
10
-
11
3
  /**
12
4
  * JavaScript-friendly OutsideExecution V3 structure
13
5
  */
@@ -19,21 +11,12 @@ export interface JsOutsideExecutionV3 {
19
11
  nonce: [JsFelt, JsFelt];
20
12
  }
21
13
 
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[];
32
- }
33
-
34
- export interface Owner {
35
- signer?: Signer;
36
- account?: JsFelt;
14
+ /**
15
+ * Result type for signExecuteFromOutside containing both the OutsideExecution and signature
16
+ */
17
+ export interface JsSignedOutsideExecution {
18
+ outside_execution: JsOutsideExecutionV3;
19
+ signature: JsFelt[];
37
20
  }
38
21
 
39
22
  export interface ApprovalPolicy {
@@ -42,7 +25,16 @@ export interface ApprovalPolicy {
42
25
  amount: JsFelt;
43
26
  }
44
27
 
45
- export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
28
+ export interface AuthorizedSession {
29
+ session: Session;
30
+ authorization: JsFelt[] | null;
31
+ isRegistered: boolean;
32
+ expiresAt: number;
33
+ allowedPoliciesRoot: JsFelt;
34
+ metadataHash: JsFelt;
35
+ sessionKeyGuid: JsFelt;
36
+ guardianKeyGuid: JsFelt;
37
+ }
46
38
 
47
39
  export interface CallPolicy {
48
40
  target: JsFelt;
@@ -50,37 +42,39 @@ export interface CallPolicy {
50
42
  authorized?: boolean;
51
43
  }
52
44
 
53
- export interface TypedDataPolicy {
54
- scope_hash: JsFelt;
55
- authorized?: boolean;
45
+ export interface Credentials {
46
+ authorization: JsFelt[];
47
+ privateKey: JsFelt;
56
48
  }
57
49
 
58
- export type JsRemoveSignerInput = SignerInput;
59
-
60
- export interface Signer {
61
- webauthns?: WebauthnSigner[];
62
- webauthn?: WebauthnSigner;
63
- starknet?: StarknetSigner;
64
- eip191?: Eip191Signer;
50
+ export interface Eip191Signer {
51
+ address: string;
65
52
  }
66
53
 
67
- export interface WebauthnSigner {
68
- rpId: string;
69
- credentialId: string;
70
- publicKey: string;
54
+ export interface JsCall {
55
+ contractAddress: JsFelt;
56
+ entrypoint: string;
57
+ calldata: JsFelt[];
71
58
  }
72
59
 
73
- export type JsAddSignerInput = SignerInput;
74
-
75
- export interface Eip191Signer {
76
- address: string;
60
+ export interface JsEstimateFeeDetails {
61
+ nonce: JsFelt;
77
62
  }
78
63
 
79
- export interface StarknetSigner {
80
- privateKey: JsFelt;
64
+ export interface JsFeeEstimate {
65
+ l1_gas_consumed: number;
66
+ l1_gas_price: number;
67
+ l2_gas_consumed: number;
68
+ l2_gas_price: number;
69
+ l1_data_gas_consumed: number;
70
+ l1_data_gas_price: number;
71
+ overall_fee: number;
81
72
  }
82
73
 
83
- export type JsRevokableSession = RevokableSession;
74
+ export interface Owner {
75
+ signer?: Signer;
76
+ account?: JsFelt;
77
+ }
84
78
 
85
79
  export interface Session {
86
80
  policies: Policy[];
@@ -90,140 +84,146 @@ export interface Session {
90
84
  guardianKeyGuid: JsFelt;
91
85
  }
92
86
 
93
- export interface AuthorizedSession {
94
- session: Session;
95
- authorization: JsFelt[] | null;
96
- isRegistered: boolean;
97
- expiresAt: number;
98
- allowedPoliciesRoot: JsFelt;
99
- metadataHash: JsFelt;
100
- sessionKeyGuid: JsFelt;
101
- guardianKeyGuid: JsFelt;
87
+ export interface Signer {
88
+ webauthns?: WebauthnSigner[];
89
+ webauthn?: WebauthnSigner;
90
+ starknet?: StarknetSigner;
91
+ eip191?: Eip191Signer;
102
92
  }
103
93
 
104
- export type JsSubscribeSessionResult = SubscribeCreateSessionSubscribeCreateSession;
105
-
106
- export interface Credentials {
107
- authorization: JsFelt[];
94
+ export interface StarknetSigner {
108
95
  privateKey: JsFelt;
109
96
  }
110
97
 
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;
98
+ export interface TypedDataPolicy {
99
+ scope_hash: JsFelt;
100
+ authorized?: boolean;
121
101
  }
122
102
 
123
- export interface JsEstimateFeeDetails {
124
- nonce: JsFelt;
103
+ export interface WebauthnSigner {
104
+ rpId: string;
105
+ credentialId: string;
106
+ publicKey: string;
125
107
  }
126
108
 
109
+ export type Felts = JsFelt[];
110
+
111
+ export type JsAddSignerInput = SignerInput;
112
+
113
+ export type JsFeeSource = "PAYMASTER" | "CREDITS";
114
+
115
+ export type JsFelt = Felt;
116
+
117
+ export type JsPriceUnit = "WEI" | "FRI";
118
+
127
119
  export type JsRegister = RegisterInput;
128
120
 
129
121
  export type JsRegisterResponse = ResponseData;
130
122
 
123
+ export type JsRemoveSignerInput = SignerInput;
124
+
125
+ export type JsRevokableSession = RevokableSession;
126
+
127
+ export type JsSubscribeSessionResult = SubscribeCreateSessionSubscribeCreateSession;
128
+
129
+ export type Policy = CallPolicy | TypedDataPolicy | ApprovalPolicy;
130
+
131
131
 
132
132
  export class CartridgeSessionAccount {
133
- private constructor();
134
- free(): void;
135
- [Symbol.dispose](): void;
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;
139
- sign(hash: JsFelt, calls: JsCall[]): Promise<Felts>;
140
- execute(calls: JsCall[]): Promise<any>;
133
+ private constructor();
134
+ free(): void;
135
+ [Symbol.dispose](): void;
136
+ execute(calls: JsCall[]): Promise<any>;
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;
139
+ static newAsRegistered(rpc_url: string, signer: JsFelt, address: JsFelt, owner_guid: JsFelt, chain_id: JsFelt, session: Session): CartridgeSessionAccount;
140
+ sign(hash: JsFelt, calls: JsCall[]): Promise<Felts>;
141
141
  }
142
142
 
143
143
  export enum ErrorCode {
144
- StarknetFailedToReceiveTransaction = 1,
145
- StarknetContractNotFound = 20,
146
- StarknetBlockNotFound = 24,
147
- StarknetInvalidTransactionIndex = 27,
148
- StarknetClassHashNotFound = 28,
149
- StarknetTransactionHashNotFound = 29,
150
- StarknetPageSizeTooBig = 31,
151
- StarknetNoBlocks = 32,
152
- StarknetInvalidContinuationToken = 33,
153
- StarknetTooManyKeysInFilter = 34,
154
- StarknetContractError = 40,
155
- StarknetTransactionExecutionError = 41,
156
- StarknetClassAlreadyDeclared = 51,
157
- StarknetInvalidTransactionNonce = 52,
158
- StarknetInsufficientMaxFee = 53,
159
- StarknetInsufficientAccountBalance = 54,
160
- StarknetValidationFailure = 55,
161
- StarknetCompilationFailed = 56,
162
- StarknetContractClassSizeIsTooLarge = 57,
163
- StarknetNonAccount = 58,
164
- StarknetDuplicateTx = 59,
165
- StarknetCompiledClassHashMismatch = 60,
166
- StarknetUnsupportedTxVersion = 61,
167
- StarknetUnsupportedContractClassVersion = 62,
168
- StarknetUnexpectedError = 63,
169
- StarknetNoTraceAvailable = 10,
170
- StarknetReplacementTransactionUnderpriced = 64,
171
- StarknetFeeBelowMinimum = 65,
172
- SignError = 101,
173
- StorageError = 102,
174
- AccountFactoryError = 103,
175
- PaymasterExecutionTimeNotReached = 104,
176
- PaymasterExecutionTimePassed = 105,
177
- PaymasterInvalidCaller = 106,
178
- PaymasterRateLimitExceeded = 107,
179
- PaymasterNotSupported = 108,
180
- PaymasterHttp = 109,
181
- PaymasterExcecution = 110,
182
- PaymasterSerialization = 111,
183
- CartridgeControllerNotDeployed = 112,
184
- InsufficientBalance = 113,
185
- OriginError = 114,
186
- EncodingError = 115,
187
- SerdeWasmBindgenError = 116,
188
- CairoSerdeError = 117,
189
- CairoShortStringToFeltError = 118,
190
- DeviceCreateCredential = 119,
191
- DeviceGetAssertion = 120,
192
- DeviceBadAssertion = 121,
193
- DeviceChannel = 122,
194
- DeviceOrigin = 123,
195
- AccountSigning = 124,
196
- AccountProvider = 125,
197
- AccountClassHashCalculation = 126,
198
- AccountFeeOutOfRange = 128,
199
- ProviderRateLimited = 129,
200
- ProviderArrayLengthMismatch = 130,
201
- ProviderOther = 131,
202
- SessionAlreadyRegistered = 132,
203
- UrlParseError = 133,
204
- Base64DecodeError = 134,
205
- CoseError = 135,
206
- PolicyChainIdMismatch = 136,
207
- InvalidOwner = 137,
208
- GasPriceTooHigh = 138,
209
- TransactionTimeout = 139,
210
- ConversionError = 140,
211
- InvalidChainId = 141,
212
- SessionRefreshRequired = 142,
213
- ManualExecutionRequired = 143,
214
- ForbiddenEntrypoint = 144,
215
- GasAmountTooHigh = 145,
216
- ApproveExecutionRequired = 146,
144
+ StarknetFailedToReceiveTransaction = 1,
145
+ StarknetContractNotFound = 20,
146
+ StarknetBlockNotFound = 24,
147
+ StarknetInvalidTransactionIndex = 27,
148
+ StarknetClassHashNotFound = 28,
149
+ StarknetTransactionHashNotFound = 29,
150
+ StarknetPageSizeTooBig = 31,
151
+ StarknetNoBlocks = 32,
152
+ StarknetInvalidContinuationToken = 33,
153
+ StarknetTooManyKeysInFilter = 34,
154
+ StarknetContractError = 40,
155
+ StarknetTransactionExecutionError = 41,
156
+ StarknetClassAlreadyDeclared = 51,
157
+ StarknetInvalidTransactionNonce = 52,
158
+ StarknetInsufficientMaxFee = 53,
159
+ StarknetInsufficientAccountBalance = 54,
160
+ StarknetValidationFailure = 55,
161
+ StarknetCompilationFailed = 56,
162
+ StarknetContractClassSizeIsTooLarge = 57,
163
+ StarknetNonAccount = 58,
164
+ StarknetDuplicateTx = 59,
165
+ StarknetCompiledClassHashMismatch = 60,
166
+ StarknetUnsupportedTxVersion = 61,
167
+ StarknetUnsupportedContractClassVersion = 62,
168
+ StarknetUnexpectedError = 63,
169
+ StarknetNoTraceAvailable = 10,
170
+ StarknetReplacementTransactionUnderpriced = 64,
171
+ StarknetFeeBelowMinimum = 65,
172
+ SignError = 101,
173
+ StorageError = 102,
174
+ AccountFactoryError = 103,
175
+ PaymasterExecutionTimeNotReached = 104,
176
+ PaymasterExecutionTimePassed = 105,
177
+ PaymasterInvalidCaller = 106,
178
+ PaymasterRateLimitExceeded = 107,
179
+ PaymasterNotSupported = 108,
180
+ PaymasterHttp = 109,
181
+ PaymasterExcecution = 110,
182
+ PaymasterSerialization = 111,
183
+ CartridgeControllerNotDeployed = 112,
184
+ InsufficientBalance = 113,
185
+ OriginError = 114,
186
+ EncodingError = 115,
187
+ SerdeWasmBindgenError = 116,
188
+ CairoSerdeError = 117,
189
+ CairoShortStringToFeltError = 118,
190
+ DeviceCreateCredential = 119,
191
+ DeviceGetAssertion = 120,
192
+ DeviceBadAssertion = 121,
193
+ DeviceChannel = 122,
194
+ DeviceOrigin = 123,
195
+ AccountSigning = 124,
196
+ AccountProvider = 125,
197
+ AccountClassHashCalculation = 126,
198
+ AccountFeeOutOfRange = 128,
199
+ ProviderRateLimited = 129,
200
+ ProviderArrayLengthMismatch = 130,
201
+ ProviderOther = 131,
202
+ SessionAlreadyRegistered = 132,
203
+ UrlParseError = 133,
204
+ Base64DecodeError = 134,
205
+ CoseError = 135,
206
+ PolicyChainIdMismatch = 136,
207
+ InvalidOwner = 137,
208
+ GasPriceTooHigh = 138,
209
+ TransactionTimeout = 139,
210
+ ConversionError = 140,
211
+ InvalidChainId = 141,
212
+ SessionRefreshRequired = 142,
213
+ ManualExecutionRequired = 143,
214
+ ForbiddenEntrypoint = 144,
215
+ GasAmountTooHigh = 145,
216
+ ApproveExecutionRequired = 146,
217
217
  }
218
218
 
219
219
  export class JsControllerError {
220
- private constructor();
221
- free(): void;
222
- [Symbol.dispose](): void;
223
- code: ErrorCode;
224
- message: string;
225
- get data(): string | undefined;
226
- set data(value: string | null | undefined);
220
+ private constructor();
221
+ free(): void;
222
+ [Symbol.dispose](): void;
223
+ code: ErrorCode;
224
+ get data(): string | undefined;
225
+ set data(value: string | null | undefined);
226
+ message: string;
227
227
  }
228
228
 
229
229
  export function signerToGuid(signer: Signer): JsFelt;
@@ -1,4 +1,9 @@
1
+ /* @ts-self-types="./session_wasm.d.ts" */
2
+
1
3
  import * as wasm from "./session_wasm_bg.wasm";
2
- export * from "./session_wasm_bg.js";
3
4
  import { __wbg_set_wasm } from "./session_wasm_bg.js";
4
- __wbg_set_wasm(wasm);
5
+ __wbg_set_wasm(wasm);
6
+
7
+ export {
8
+ CartridgeSessionAccount, ErrorCode, JsControllerError, signerToGuid, subscribeCreateSession
9
+ } from "./session_wasm_bg.js";