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