@cartridge/controller-wasm 0.7.14-de92897 → 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.
- package/package.json +3 -4
- package/pkg-controller/account_wasm.d.ts +338 -309
- package/pkg-controller/account_wasm.js +7 -2
- package/pkg-controller/account_wasm_bg.js +1012 -1152
- package/pkg-controller/account_wasm_bg.wasm +0 -0
- package/pkg-session/session_wasm.d.ts +158 -158
- package/pkg-session/session_wasm.js +7 -2
- package/pkg-session/session_wasm_bg.js +605 -712
- package/pkg-session/session_wasm_bg.wasm +0 -0
|
Binary file
|
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export interface JsCall {
|
|
4
|
-
contractAddress: JsFelt;
|
|
5
|
-
entrypoint: string;
|
|
6
|
-
calldata: JsFelt[];
|
|
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;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
3
|
/**
|
|
26
4
|
* JavaScript-friendly OutsideExecution V3 structure
|
|
27
5
|
*/
|
|
@@ -41,9 +19,21 @@ export interface JsSignedOutsideExecution {
|
|
|
41
19
|
signature: JsFelt[];
|
|
42
20
|
}
|
|
43
21
|
|
|
44
|
-
export interface
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
export interface ApprovalPolicy {
|
|
23
|
+
target: JsFelt;
|
|
24
|
+
spender: JsFelt;
|
|
25
|
+
amount: JsFelt;
|
|
26
|
+
}
|
|
27
|
+
|
|
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;
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
export interface CallPolicy {
|
|
@@ -52,35 +42,46 @@ export interface CallPolicy {
|
|
|
52
42
|
authorized?: boolean;
|
|
53
43
|
}
|
|
54
44
|
|
|
55
|
-
export interface
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
export interface Credentials {
|
|
46
|
+
authorization: JsFelt[];
|
|
47
|
+
privateKey: JsFelt;
|
|
58
48
|
}
|
|
59
49
|
|
|
60
|
-
export interface
|
|
61
|
-
|
|
62
|
-
spender: JsFelt;
|
|
63
|
-
amount: JsFelt;
|
|
50
|
+
export interface Eip191Signer {
|
|
51
|
+
address: string;
|
|
64
52
|
}
|
|
65
53
|
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
export interface JsCall {
|
|
55
|
+
contractAddress: JsFelt;
|
|
56
|
+
entrypoint: string;
|
|
57
|
+
calldata: JsFelt[];
|
|
58
|
+
}
|
|
69
59
|
|
|
70
|
-
export
|
|
60
|
+
export interface JsEstimateFeeDetails {
|
|
61
|
+
nonce: JsFelt;
|
|
62
|
+
}
|
|
71
63
|
|
|
72
|
-
export interface
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
export interface
|
|
79
|
-
|
|
74
|
+
export interface Owner {
|
|
75
|
+
signer?: Signer;
|
|
76
|
+
account?: JsFelt;
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
export interface
|
|
83
|
-
|
|
79
|
+
export interface Session {
|
|
80
|
+
policies: Policy[];
|
|
81
|
+
expiresAt: number;
|
|
82
|
+
metadataHash: JsFelt;
|
|
83
|
+
sessionKeyGuid: JsFelt;
|
|
84
|
+
guardianKeyGuid: JsFelt;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export interface Signer {
|
|
@@ -90,140 +91,139 @@ export interface Signer {
|
|
|
90
91
|
eip191?: Eip191Signer;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
export
|
|
94
|
+
export interface StarknetSigner {
|
|
95
|
+
privateKey: JsFelt;
|
|
96
|
+
}
|
|
94
97
|
|
|
95
|
-
export
|
|
98
|
+
export interface TypedDataPolicy {
|
|
99
|
+
scope_hash: JsFelt;
|
|
100
|
+
authorized?: boolean;
|
|
101
|
+
}
|
|
96
102
|
|
|
97
|
-
export
|
|
103
|
+
export interface WebauthnSigner {
|
|
104
|
+
rpId: string;
|
|
105
|
+
credentialId: string;
|
|
106
|
+
publicKey: string;
|
|
107
|
+
}
|
|
98
108
|
|
|
99
109
|
export type Felts = JsFelt[];
|
|
100
110
|
|
|
111
|
+
export type JsAddSignerInput = SignerInput;
|
|
112
|
+
|
|
101
113
|
export type JsFeeSource = "PAYMASTER" | "CREDITS";
|
|
102
114
|
|
|
103
|
-
export type
|
|
115
|
+
export type JsFelt = Felt;
|
|
104
116
|
|
|
105
|
-
export type
|
|
117
|
+
export type JsPriceUnit = "WEI" | "FRI";
|
|
106
118
|
|
|
107
|
-
export
|
|
108
|
-
session: Session;
|
|
109
|
-
authorization: JsFelt[] | null;
|
|
110
|
-
isRegistered: boolean;
|
|
111
|
-
expiresAt: number;
|
|
112
|
-
allowedPoliciesRoot: JsFelt;
|
|
113
|
-
metadataHash: JsFelt;
|
|
114
|
-
sessionKeyGuid: JsFelt;
|
|
115
|
-
guardianKeyGuid: JsFelt;
|
|
116
|
-
}
|
|
119
|
+
export type JsRegister = RegisterInput;
|
|
117
120
|
|
|
118
|
-
export
|
|
119
|
-
policies: Policy[];
|
|
120
|
-
expiresAt: number;
|
|
121
|
-
metadataHash: JsFelt;
|
|
122
|
-
sessionKeyGuid: JsFelt;
|
|
123
|
-
guardianKeyGuid: JsFelt;
|
|
124
|
-
}
|
|
121
|
+
export type JsRegisterResponse = ResponseData;
|
|
125
122
|
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
130
|
|
|
131
131
|
|
|
132
132
|
export class CartridgeSessionAccount {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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";
|