starknet 6.7.0 → 6.8.0
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/CHANGELOG.md +14 -0
- package/README.md +2 -0
- package/dist/index.d.ts +644 -1258
- package/dist/index.global.js +196 -164
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +190 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +175 -274
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -67,7 +68,7 @@ __export(src_exports, {
|
|
|
67
68
|
TransactionFinalityStatus: () => TransactionFinalityStatus,
|
|
68
69
|
TransactionStatus: () => TransactionStatus,
|
|
69
70
|
TransactionType: () => TransactionType,
|
|
70
|
-
TypedDataRevision: () =>
|
|
71
|
+
TypedDataRevision: () => import_starknet_types_07.TypedDataRevision,
|
|
71
72
|
UINT_128_MAX: () => UINT_128_MAX,
|
|
72
73
|
UINT_128_MIN: () => UINT_128_MIN,
|
|
73
74
|
UINT_256_HIGH_MAX: () => UINT_256_HIGH_MAX,
|
|
@@ -104,6 +105,7 @@ __export(src_exports, {
|
|
|
104
105
|
merkle: () => merkle_exports,
|
|
105
106
|
num: () => num_exports,
|
|
106
107
|
number: () => number,
|
|
108
|
+
parseCalldataField: () => parseCalldataField,
|
|
107
109
|
parseUDCEvent: () => parseUDCEvent,
|
|
108
110
|
provider: () => provider_exports,
|
|
109
111
|
selector: () => selector_exports,
|
|
@@ -141,7 +143,7 @@ __export(constants_exports, {
|
|
|
141
143
|
RPC_NODES: () => RPC_NODES,
|
|
142
144
|
StarknetChainId: () => StarknetChainId,
|
|
143
145
|
TEXT_TO_FELT_MAX_LEN: () => TEXT_TO_FELT_MAX_LEN,
|
|
144
|
-
TRANSACTION_VERSION: () =>
|
|
146
|
+
TRANSACTION_VERSION: () => api_exports.ETransactionVersion,
|
|
145
147
|
TransactionHashPrefix: () => TransactionHashPrefix,
|
|
146
148
|
UDC: () => UDC,
|
|
147
149
|
ZERO: () => ZERO,
|
|
@@ -151,22 +153,9 @@ __export(constants_exports, {
|
|
|
151
153
|
// src/types/api/index.ts
|
|
152
154
|
var api_exports = {};
|
|
153
155
|
__export(api_exports, {
|
|
154
|
-
EBlockTag: () => EBlockTag2,
|
|
155
|
-
EDAMode: () => EDAMode2,
|
|
156
|
-
EDataAvailabilityMode: () => EDataAvailabilityMode2,
|
|
157
|
-
ESimulationFlag: () => ESimulationFlag2,
|
|
158
|
-
ETransactionExecutionStatus: () => ETransactionExecutionStatus2,
|
|
159
|
-
ETransactionFinalityStatus: () => ETransactionFinalityStatus2,
|
|
160
|
-
ETransactionStatus: () => ETransactionStatus2,
|
|
161
|
-
ETransactionType: () => ETransactionType2,
|
|
162
|
-
ETransactionVersion: () => ETransactionVersion4,
|
|
163
|
-
ETransactionVersion2: () => ETransactionVersion22,
|
|
164
|
-
ETransactionVersion3: () => ETransactionVersion32,
|
|
165
|
-
Errors: () => errors_exports2,
|
|
166
156
|
JRPC: () => jsonrpc_exports,
|
|
167
157
|
RPCSPEC06: () => rpcspec_0_6_exports,
|
|
168
|
-
RPCSPEC07: () =>
|
|
169
|
-
SPEC: () => components_exports2
|
|
158
|
+
RPCSPEC07: () => RPCSPEC07
|
|
170
159
|
});
|
|
171
160
|
|
|
172
161
|
// src/types/api/jsonrpc/index.ts
|
|
@@ -197,40 +186,40 @@ var errors_exports = {};
|
|
|
197
186
|
var components_exports = {};
|
|
198
187
|
|
|
199
188
|
// src/types/api/rpcspec_0_6/nonspec.ts
|
|
200
|
-
var ETransactionType = /* @__PURE__ */ ((
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return
|
|
189
|
+
var ETransactionType = /* @__PURE__ */ ((ETransactionType2) => {
|
|
190
|
+
ETransactionType2["DECLARE"] = "DECLARE";
|
|
191
|
+
ETransactionType2["DEPLOY"] = "DEPLOY";
|
|
192
|
+
ETransactionType2["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT";
|
|
193
|
+
ETransactionType2["INVOKE"] = "INVOKE";
|
|
194
|
+
ETransactionType2["L1_HANDLER"] = "L1_HANDLER";
|
|
195
|
+
return ETransactionType2;
|
|
207
196
|
})(ETransactionType || {});
|
|
208
|
-
var ESimulationFlag = /* @__PURE__ */ ((
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
return
|
|
197
|
+
var ESimulationFlag = /* @__PURE__ */ ((ESimulationFlag2) => {
|
|
198
|
+
ESimulationFlag2["SKIP_VALIDATE"] = "SKIP_VALIDATE";
|
|
199
|
+
ESimulationFlag2["SKIP_FEE_CHARGE"] = "SKIP_FEE_CHARGE";
|
|
200
|
+
return ESimulationFlag2;
|
|
212
201
|
})(ESimulationFlag || {});
|
|
213
|
-
var ETransactionStatus = /* @__PURE__ */ ((
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return
|
|
202
|
+
var ETransactionStatus = /* @__PURE__ */ ((ETransactionStatus2) => {
|
|
203
|
+
ETransactionStatus2["RECEIVED"] = "RECEIVED";
|
|
204
|
+
ETransactionStatus2["REJECTED"] = "REJECTED";
|
|
205
|
+
ETransactionStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2";
|
|
206
|
+
ETransactionStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1";
|
|
207
|
+
return ETransactionStatus2;
|
|
219
208
|
})(ETransactionStatus || {});
|
|
220
|
-
var ETransactionFinalityStatus = /* @__PURE__ */ ((
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return
|
|
209
|
+
var ETransactionFinalityStatus = /* @__PURE__ */ ((ETransactionFinalityStatus2) => {
|
|
210
|
+
ETransactionFinalityStatus2["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2";
|
|
211
|
+
ETransactionFinalityStatus2["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1";
|
|
212
|
+
return ETransactionFinalityStatus2;
|
|
224
213
|
})(ETransactionFinalityStatus || {});
|
|
225
|
-
var ETransactionExecutionStatus = /* @__PURE__ */ ((
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return
|
|
214
|
+
var ETransactionExecutionStatus = /* @__PURE__ */ ((ETransactionExecutionStatus2) => {
|
|
215
|
+
ETransactionExecutionStatus2["SUCCEEDED"] = "SUCCEEDED";
|
|
216
|
+
ETransactionExecutionStatus2["REVERTED"] = "REVERTED";
|
|
217
|
+
return ETransactionExecutionStatus2;
|
|
229
218
|
})(ETransactionExecutionStatus || {});
|
|
230
|
-
var EBlockTag = /* @__PURE__ */ ((
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return
|
|
219
|
+
var EBlockTag = /* @__PURE__ */ ((EBlockTag2) => {
|
|
220
|
+
EBlockTag2["LATEST"] = "latest";
|
|
221
|
+
EBlockTag2["PENDING"] = "pending";
|
|
222
|
+
return EBlockTag2;
|
|
234
223
|
})(EBlockTag || {});
|
|
235
224
|
var EDataAvailabilityMode = /* @__PURE__ */ ((EDataAvailabilityMode3) => {
|
|
236
225
|
EDataAvailabilityMode3["L1"] = "L1";
|
|
@@ -242,127 +231,35 @@ var EDAMode = /* @__PURE__ */ ((EDAMode4) => {
|
|
|
242
231
|
EDAMode4[EDAMode4["L2"] = 1] = "L2";
|
|
243
232
|
return EDAMode4;
|
|
244
233
|
})(EDAMode || {});
|
|
245
|
-
var ETransactionVersion = /* @__PURE__ */ ((
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return
|
|
234
|
+
var ETransactionVersion = /* @__PURE__ */ ((ETransactionVersion10) => {
|
|
235
|
+
ETransactionVersion10["V0"] = "0x0";
|
|
236
|
+
ETransactionVersion10["V1"] = "0x1";
|
|
237
|
+
ETransactionVersion10["V2"] = "0x2";
|
|
238
|
+
ETransactionVersion10["V3"] = "0x3";
|
|
239
|
+
ETransactionVersion10["F0"] = "0x100000000000000000000000000000000";
|
|
240
|
+
ETransactionVersion10["F1"] = "0x100000000000000000000000000000001";
|
|
241
|
+
ETransactionVersion10["F2"] = "0x100000000000000000000000000000002";
|
|
242
|
+
ETransactionVersion10["F3"] = "0x100000000000000000000000000000003";
|
|
243
|
+
return ETransactionVersion10;
|
|
255
244
|
})(ETransactionVersion || {});
|
|
256
|
-
var ETransactionVersion2 = /* @__PURE__ */ ((
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
return
|
|
245
|
+
var ETransactionVersion2 = /* @__PURE__ */ ((ETransactionVersion25) => {
|
|
246
|
+
ETransactionVersion25["V0"] = "0x0";
|
|
247
|
+
ETransactionVersion25["V1"] = "0x1";
|
|
248
|
+
ETransactionVersion25["V2"] = "0x2";
|
|
249
|
+
ETransactionVersion25["F0"] = "0x100000000000000000000000000000000";
|
|
250
|
+
ETransactionVersion25["F1"] = "0x100000000000000000000000000000001";
|
|
251
|
+
ETransactionVersion25["F2"] = "0x100000000000000000000000000000002";
|
|
252
|
+
return ETransactionVersion25;
|
|
264
253
|
})(ETransactionVersion2 || {});
|
|
265
|
-
var ETransactionVersion3 = /* @__PURE__ */ ((
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return
|
|
254
|
+
var ETransactionVersion3 = /* @__PURE__ */ ((ETransactionVersion36) => {
|
|
255
|
+
ETransactionVersion36["V3"] = "0x3";
|
|
256
|
+
ETransactionVersion36["F3"] = "0x100000000000000000000000000000003";
|
|
257
|
+
return ETransactionVersion36;
|
|
269
258
|
})(ETransactionVersion3 || {});
|
|
270
259
|
|
|
271
|
-
// src/types/api/
|
|
272
|
-
var
|
|
273
|
-
|
|
274
|
-
EBlockTag: () => EBlockTag2,
|
|
275
|
-
EDAMode: () => EDAMode2,
|
|
276
|
-
EDataAvailabilityMode: () => EDataAvailabilityMode2,
|
|
277
|
-
ESimulationFlag: () => ESimulationFlag2,
|
|
278
|
-
ETransactionExecutionStatus: () => ETransactionExecutionStatus2,
|
|
279
|
-
ETransactionFinalityStatus: () => ETransactionFinalityStatus2,
|
|
280
|
-
ETransactionStatus: () => ETransactionStatus2,
|
|
281
|
-
ETransactionType: () => ETransactionType2,
|
|
282
|
-
ETransactionVersion: () => ETransactionVersion4,
|
|
283
|
-
ETransactionVersion2: () => ETransactionVersion22,
|
|
284
|
-
ETransactionVersion3: () => ETransactionVersion32,
|
|
285
|
-
Errors: () => errors_exports2,
|
|
286
|
-
SPEC: () => components_exports2
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
// src/types/api/rpcspec_0_7/errors.ts
|
|
290
|
-
var errors_exports2 = {};
|
|
291
|
-
|
|
292
|
-
// src/types/api/rpcspec_0_7/components.ts
|
|
293
|
-
var components_exports2 = {};
|
|
294
|
-
|
|
295
|
-
// src/types/api/rpcspec_0_7/nonspec.ts
|
|
296
|
-
var ETransactionType2 = /* @__PURE__ */ ((ETransactionType3) => {
|
|
297
|
-
ETransactionType3["DECLARE"] = "DECLARE";
|
|
298
|
-
ETransactionType3["DEPLOY"] = "DEPLOY";
|
|
299
|
-
ETransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT";
|
|
300
|
-
ETransactionType3["INVOKE"] = "INVOKE";
|
|
301
|
-
ETransactionType3["L1_HANDLER"] = "L1_HANDLER";
|
|
302
|
-
return ETransactionType3;
|
|
303
|
-
})(ETransactionType2 || {});
|
|
304
|
-
var ESimulationFlag2 = /* @__PURE__ */ ((ESimulationFlag3) => {
|
|
305
|
-
ESimulationFlag3["SKIP_VALIDATE"] = "SKIP_VALIDATE";
|
|
306
|
-
ESimulationFlag3["SKIP_FEE_CHARGE"] = "SKIP_FEE_CHARGE";
|
|
307
|
-
return ESimulationFlag3;
|
|
308
|
-
})(ESimulationFlag2 || {});
|
|
309
|
-
var ETransactionStatus2 = /* @__PURE__ */ ((ETransactionStatus3) => {
|
|
310
|
-
ETransactionStatus3["RECEIVED"] = "RECEIVED";
|
|
311
|
-
ETransactionStatus3["REJECTED"] = "REJECTED";
|
|
312
|
-
ETransactionStatus3["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2";
|
|
313
|
-
ETransactionStatus3["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1";
|
|
314
|
-
return ETransactionStatus3;
|
|
315
|
-
})(ETransactionStatus2 || {});
|
|
316
|
-
var ETransactionFinalityStatus2 = /* @__PURE__ */ ((ETransactionFinalityStatus3) => {
|
|
317
|
-
ETransactionFinalityStatus3["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2";
|
|
318
|
-
ETransactionFinalityStatus3["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1";
|
|
319
|
-
return ETransactionFinalityStatus3;
|
|
320
|
-
})(ETransactionFinalityStatus2 || {});
|
|
321
|
-
var ETransactionExecutionStatus2 = /* @__PURE__ */ ((ETransactionExecutionStatus3) => {
|
|
322
|
-
ETransactionExecutionStatus3["SUCCEEDED"] = "SUCCEEDED";
|
|
323
|
-
ETransactionExecutionStatus3["REVERTED"] = "REVERTED";
|
|
324
|
-
return ETransactionExecutionStatus3;
|
|
325
|
-
})(ETransactionExecutionStatus2 || {});
|
|
326
|
-
var EBlockTag2 = /* @__PURE__ */ ((EBlockTag3) => {
|
|
327
|
-
EBlockTag3["LATEST"] = "latest";
|
|
328
|
-
EBlockTag3["PENDING"] = "pending";
|
|
329
|
-
return EBlockTag3;
|
|
330
|
-
})(EBlockTag2 || {});
|
|
331
|
-
var EDataAvailabilityMode2 = /* @__PURE__ */ ((EDataAvailabilityMode3) => {
|
|
332
|
-
EDataAvailabilityMode3["L1"] = "L1";
|
|
333
|
-
EDataAvailabilityMode3["L2"] = "L2";
|
|
334
|
-
return EDataAvailabilityMode3;
|
|
335
|
-
})(EDataAvailabilityMode2 || {});
|
|
336
|
-
var EDAMode2 = /* @__PURE__ */ ((EDAMode4) => {
|
|
337
|
-
EDAMode4[EDAMode4["L1"] = 0] = "L1";
|
|
338
|
-
EDAMode4[EDAMode4["L2"] = 1] = "L2";
|
|
339
|
-
return EDAMode4;
|
|
340
|
-
})(EDAMode2 || {});
|
|
341
|
-
var ETransactionVersion4 = /* @__PURE__ */ ((ETransactionVersion5) => {
|
|
342
|
-
ETransactionVersion5["V0"] = "0x0";
|
|
343
|
-
ETransactionVersion5["V1"] = "0x1";
|
|
344
|
-
ETransactionVersion5["V2"] = "0x2";
|
|
345
|
-
ETransactionVersion5["V3"] = "0x3";
|
|
346
|
-
ETransactionVersion5["F0"] = "0x100000000000000000000000000000000";
|
|
347
|
-
ETransactionVersion5["F1"] = "0x100000000000000000000000000000001";
|
|
348
|
-
ETransactionVersion5["F2"] = "0x100000000000000000000000000000002";
|
|
349
|
-
ETransactionVersion5["F3"] = "0x100000000000000000000000000000003";
|
|
350
|
-
return ETransactionVersion5;
|
|
351
|
-
})(ETransactionVersion4 || {});
|
|
352
|
-
var ETransactionVersion22 = /* @__PURE__ */ ((ETransactionVersion24) => {
|
|
353
|
-
ETransactionVersion24["V0"] = "0x0";
|
|
354
|
-
ETransactionVersion24["V1"] = "0x1";
|
|
355
|
-
ETransactionVersion24["V2"] = "0x2";
|
|
356
|
-
ETransactionVersion24["F0"] = "0x100000000000000000000000000000000";
|
|
357
|
-
ETransactionVersion24["F1"] = "0x100000000000000000000000000000001";
|
|
358
|
-
ETransactionVersion24["F2"] = "0x100000000000000000000000000000002";
|
|
359
|
-
return ETransactionVersion24;
|
|
360
|
-
})(ETransactionVersion22 || {});
|
|
361
|
-
var ETransactionVersion32 = /* @__PURE__ */ ((ETransactionVersion34) => {
|
|
362
|
-
ETransactionVersion34["V3"] = "0x3";
|
|
363
|
-
ETransactionVersion34["F3"] = "0x100000000000000000000000000000003";
|
|
364
|
-
return ETransactionVersion34;
|
|
365
|
-
})(ETransactionVersion32 || {});
|
|
260
|
+
// src/types/api/index.ts
|
|
261
|
+
var RPCSPEC07 = __toESM(require("starknet-types-07"));
|
|
262
|
+
__reExport(api_exports, require("starknet-types-07"));
|
|
366
263
|
|
|
367
264
|
// src/utils/encode.ts
|
|
368
265
|
var encode_exports = {};
|
|
@@ -559,7 +456,7 @@ __export(types_exports, {
|
|
|
559
456
|
TransactionFinalityStatus: () => TransactionFinalityStatus,
|
|
560
457
|
TransactionStatus: () => TransactionStatus,
|
|
561
458
|
TransactionType: () => TransactionType,
|
|
562
|
-
TypedDataRevision: () =>
|
|
459
|
+
TypedDataRevision: () => import_starknet_types_07.TypedDataRevision,
|
|
563
460
|
Uint: () => Uint,
|
|
564
461
|
ValidateType: () => ValidateType
|
|
565
462
|
});
|
|
@@ -647,7 +544,7 @@ var BlockTag = /* @__PURE__ */ ((BlockTag2) => {
|
|
|
647
544
|
})(BlockTag || {});
|
|
648
545
|
|
|
649
546
|
// src/types/typedData.ts
|
|
650
|
-
var
|
|
547
|
+
var import_starknet_types_07 = require("starknet-types-07");
|
|
651
548
|
|
|
652
549
|
// src/utils/assert.ts
|
|
653
550
|
function assert(condition, message) {
|
|
@@ -2855,7 +2752,7 @@ function calculateInvokeTransactionHash(senderAddress, version, compiledCalldata
|
|
|
2855
2752
|
|
|
2856
2753
|
// src/utils/hash/transactionHash/index.ts
|
|
2857
2754
|
function isV3InvokeTx(args) {
|
|
2858
|
-
return [
|
|
2755
|
+
return [api_exports.ETransactionVersion.V3, api_exports.ETransactionVersion.F3].includes(
|
|
2859
2756
|
args.version
|
|
2860
2757
|
);
|
|
2861
2758
|
}
|
|
@@ -2885,7 +2782,7 @@ function calculateInvokeTransactionHash2(args) {
|
|
|
2885
2782
|
);
|
|
2886
2783
|
}
|
|
2887
2784
|
function isV3DeclareTx(args) {
|
|
2888
|
-
return [
|
|
2785
|
+
return [api_exports.ETransactionVersion.V3, api_exports.ETransactionVersion.F3].includes(
|
|
2889
2786
|
args.version
|
|
2890
2787
|
);
|
|
2891
2788
|
}
|
|
@@ -2917,7 +2814,7 @@ function calculateDeclareTransactionHash3(args) {
|
|
|
2917
2814
|
);
|
|
2918
2815
|
}
|
|
2919
2816
|
function isV3DeployAccountTx(args) {
|
|
2920
|
-
return [
|
|
2817
|
+
return [api_exports.ETransactionVersion.V3, api_exports.ETransactionVersion.F3].includes(
|
|
2921
2818
|
args.version
|
|
2922
2819
|
);
|
|
2923
2820
|
}
|
|
@@ -3212,19 +3109,19 @@ function estimateFeeToBounds(estimate, amountOverhead = 50 /* L1_BOUND_MAX_AMOUN
|
|
|
3212
3109
|
};
|
|
3213
3110
|
}
|
|
3214
3111
|
function intDAM(dam) {
|
|
3215
|
-
if (dam ===
|
|
3216
|
-
return
|
|
3217
|
-
if (dam ===
|
|
3218
|
-
return
|
|
3112
|
+
if (dam === api_exports.EDataAvailabilityMode.L1)
|
|
3113
|
+
return api_exports.EDAMode.L1;
|
|
3114
|
+
if (dam === api_exports.EDataAvailabilityMode.L2)
|
|
3115
|
+
return api_exports.EDAMode.L2;
|
|
3219
3116
|
throw Error("EDAM conversion");
|
|
3220
3117
|
}
|
|
3221
3118
|
function toTransactionVersion(defaultVersion, providedVersion) {
|
|
3222
3119
|
const providedVersion0xs = providedVersion ? toHex(providedVersion) : void 0;
|
|
3223
3120
|
const defaultVersion0xs = toHex(defaultVersion);
|
|
3224
|
-
if (providedVersion && !Object.values(
|
|
3121
|
+
if (providedVersion && !Object.values(api_exports.ETransactionVersion).includes(providedVersion0xs)) {
|
|
3225
3122
|
throw Error(`providedVersion ${providedVersion} is not ETransactionVersion`);
|
|
3226
3123
|
}
|
|
3227
|
-
if (!Object.values(
|
|
3124
|
+
if (!Object.values(api_exports.ETransactionVersion).includes(defaultVersion0xs)) {
|
|
3228
3125
|
throw Error(`defaultVersion ${defaultVersion} is not ETransactionVersion`);
|
|
3229
3126
|
}
|
|
3230
3127
|
return providedVersion ? providedVersion0xs : defaultVersion0xs;
|
|
@@ -3233,14 +3130,14 @@ function toFeeVersion(providedVersion) {
|
|
|
3233
3130
|
if (!providedVersion)
|
|
3234
3131
|
return void 0;
|
|
3235
3132
|
const version = toHex(providedVersion);
|
|
3236
|
-
if (version ===
|
|
3237
|
-
return
|
|
3238
|
-
if (version ===
|
|
3239
|
-
return
|
|
3240
|
-
if (version ===
|
|
3241
|
-
return
|
|
3242
|
-
if (version ===
|
|
3243
|
-
return
|
|
3133
|
+
if (version === api_exports.ETransactionVersion.V0)
|
|
3134
|
+
return api_exports.ETransactionVersion.F0;
|
|
3135
|
+
if (version === api_exports.ETransactionVersion.V1)
|
|
3136
|
+
return api_exports.ETransactionVersion.F1;
|
|
3137
|
+
if (version === api_exports.ETransactionVersion.V2)
|
|
3138
|
+
return api_exports.ETransactionVersion.F2;
|
|
3139
|
+
if (version === api_exports.ETransactionVersion.V3)
|
|
3140
|
+
return api_exports.ETransactionVersion.F3;
|
|
3244
3141
|
throw Error(`toFeeVersion: ${version} is not supported`);
|
|
3245
3142
|
}
|
|
3246
3143
|
function v3Details(details) {
|
|
@@ -3248,16 +3145,16 @@ function v3Details(details) {
|
|
|
3248
3145
|
tip: details.tip || 0,
|
|
3249
3146
|
paymasterData: details.paymasterData || [],
|
|
3250
3147
|
accountDeploymentData: details.accountDeploymentData || [],
|
|
3251
|
-
nonceDataAvailabilityMode: details.nonceDataAvailabilityMode ||
|
|
3252
|
-
feeDataAvailabilityMode: details.feeDataAvailabilityMode ||
|
|
3148
|
+
nonceDataAvailabilityMode: details.nonceDataAvailabilityMode || api_exports.EDataAvailabilityMode.L1,
|
|
3149
|
+
feeDataAvailabilityMode: details.feeDataAvailabilityMode || api_exports.EDataAvailabilityMode.L1,
|
|
3253
3150
|
resourceBounds: details.resourceBounds ?? estimateFeeToBounds(ZERO)
|
|
3254
3151
|
};
|
|
3255
3152
|
}
|
|
3256
3153
|
function reduceV2(providedVersion) {
|
|
3257
|
-
if (providedVersion ===
|
|
3258
|
-
return
|
|
3259
|
-
if (providedVersion ===
|
|
3260
|
-
return
|
|
3154
|
+
if (providedVersion === api_exports.ETransactionVersion.F2)
|
|
3155
|
+
return api_exports.ETransactionVersion.F1;
|
|
3156
|
+
if (providedVersion === api_exports.ETransactionVersion.V2)
|
|
3157
|
+
return api_exports.ETransactionVersion.V1;
|
|
3261
3158
|
return providedVersion;
|
|
3262
3159
|
}
|
|
3263
3160
|
|
|
@@ -3355,9 +3252,10 @@ function parseContract(contract) {
|
|
|
3355
3252
|
return createSierraContractClass(parsedContract);
|
|
3356
3253
|
}
|
|
3357
3254
|
var getDefaultNodeUrl = (networkName, mute = false) => {
|
|
3358
|
-
if (!mute)
|
|
3255
|
+
if (!mute) {
|
|
3359
3256
|
console.warn("Using default public node url, please provide nodeUrl in provider options!");
|
|
3360
|
-
|
|
3257
|
+
}
|
|
3258
|
+
const nodes = RPC_NODES[networkName ?? "SN_SEPOLIA" /* SN_SEPOLIA */];
|
|
3361
3259
|
const randIdx = Math.floor(Math.random() * nodes.length);
|
|
3362
3260
|
return nodes[randIdx];
|
|
3363
3261
|
};
|
|
@@ -3380,10 +3278,14 @@ var Block = class {
|
|
|
3380
3278
|
tag = null;
|
|
3381
3279
|
setIdentifier(__identifier) {
|
|
3382
3280
|
if (isString(__identifier)) {
|
|
3383
|
-
if (
|
|
3281
|
+
if (isDecimalString(__identifier)) {
|
|
3282
|
+
this.number = parseInt(__identifier, 10);
|
|
3283
|
+
} else if (isHex(__identifier)) {
|
|
3384
3284
|
this.hash = __identifier;
|
|
3385
3285
|
} else if (validBlockTags.includes(__identifier)) {
|
|
3386
3286
|
this.tag = __identifier;
|
|
3287
|
+
} else {
|
|
3288
|
+
throw TypeError(`Block identifier unmanaged: ${__identifier}`);
|
|
3387
3289
|
}
|
|
3388
3290
|
} else if (isBigInt(__identifier)) {
|
|
3389
3291
|
this.hash = toHex(__identifier);
|
|
@@ -3392,6 +3294,9 @@ var Block = class {
|
|
|
3392
3294
|
} else {
|
|
3393
3295
|
this.tag = "pending" /* pending */;
|
|
3394
3296
|
}
|
|
3297
|
+
if (isNumber(this.number) && this.number < 0) {
|
|
3298
|
+
throw TypeError(`Block number (${this.number}) can't be negative`);
|
|
3299
|
+
}
|
|
3395
3300
|
}
|
|
3396
3301
|
constructor(_identifier) {
|
|
3397
3302
|
this.setIdentifier(_identifier);
|
|
@@ -3421,15 +3326,10 @@ var Block = class {
|
|
|
3421
3326
|
}
|
|
3422
3327
|
valueOf = () => this.number;
|
|
3423
3328
|
toString = () => this.hash;
|
|
3424
|
-
/* get sequencerIdentifier(): SequencerIdentifier {
|
|
3425
|
-
return this.hash !== null
|
|
3426
|
-
? { blockHash: this.hash as string }
|
|
3427
|
-
: { blockNumber: (this.number ?? this.tag) as BlockNumber };
|
|
3428
|
-
} */
|
|
3429
3329
|
};
|
|
3430
3330
|
function isV3Tx(details) {
|
|
3431
|
-
const version = details.version ? toHex(details.version) :
|
|
3432
|
-
return version ===
|
|
3331
|
+
const version = details.version ? toHex(details.version) : api_exports.ETransactionVersion.V3;
|
|
3332
|
+
return version === api_exports.ETransactionVersion.V3 || version === api_exports.ETransactionVersion.F3;
|
|
3433
3333
|
}
|
|
3434
3334
|
function isVersion(version, response) {
|
|
3435
3335
|
const [majorS, minorS] = version.split(".");
|
|
@@ -3544,10 +3444,10 @@ function buildUDCCall(payload, address) {
|
|
|
3544
3444
|
}
|
|
3545
3445
|
function getVersionsByType(versionType) {
|
|
3546
3446
|
return versionType === "fee" ? {
|
|
3547
|
-
v1:
|
|
3548
|
-
v2:
|
|
3549
|
-
v3:
|
|
3550
|
-
} : { v1:
|
|
3447
|
+
v1: api_exports.ETransactionVersion.F1,
|
|
3448
|
+
v2: api_exports.ETransactionVersion.F2,
|
|
3449
|
+
v3: api_exports.ETransactionVersion.F3
|
|
3450
|
+
} : { v1: api_exports.ETransactionVersion.V1, v2: api_exports.ETransactionVersion.V2, v3: api_exports.ETransactionVersion.V3 };
|
|
3551
3451
|
}
|
|
3552
3452
|
|
|
3553
3453
|
// src/channel/rpc_0_6.ts
|
|
@@ -4035,7 +3935,6 @@ var RpcChannel = class {
|
|
|
4035
3935
|
return {
|
|
4036
3936
|
// v0 v1 v3
|
|
4037
3937
|
type: rpcspec_0_6_exports.ETransactionType.INVOKE,
|
|
4038
|
-
// TODO: Diff between sequencer and rpc invoke type
|
|
4039
3938
|
sender_address: invocation.contractAddress,
|
|
4040
3939
|
calldata: CallData.toHex(invocation.calldata),
|
|
4041
3940
|
version: toHex(invocation.version || defaultVersions.v3),
|
|
@@ -4254,9 +4153,9 @@ var RpcChannel2 = class {
|
|
|
4254
4153
|
const block_id = new Block(blockIdentifier).identifier;
|
|
4255
4154
|
const simulationFlags = [];
|
|
4256
4155
|
if (skipValidate)
|
|
4257
|
-
simulationFlags.push(
|
|
4156
|
+
simulationFlags.push(RPCSPEC07.ESimulationFlag.SKIP_VALIDATE);
|
|
4258
4157
|
if (skipFeeCharge)
|
|
4259
|
-
simulationFlags.push(
|
|
4158
|
+
simulationFlags.push(RPCSPEC07.ESimulationFlag.SKIP_FEE_CHARGE);
|
|
4260
4159
|
return this.fetchEndpoint("starknet_simulateTransactions", {
|
|
4261
4160
|
block_id,
|
|
4262
4161
|
transactions: invocations.map((it) => this.buildTransaction(it)),
|
|
@@ -4270,15 +4169,15 @@ var RpcChannel2 = class {
|
|
|
4270
4169
|
let isErrorState = false;
|
|
4271
4170
|
const retryInterval = options?.retryInterval ?? 5e3;
|
|
4272
4171
|
const errorStates = options?.errorStates ?? [
|
|
4273
|
-
|
|
4172
|
+
RPCSPEC07.ETransactionStatus.REJECTED
|
|
4274
4173
|
// TODO: commented out to preserve the long-standing behavior of "reverted" not being treated as an error by default
|
|
4275
4174
|
// should decide which behavior to keep in the future
|
|
4276
4175
|
// RPC.ETransactionExecutionStatus.REVERTED,
|
|
4277
4176
|
];
|
|
4278
4177
|
const successStates = options?.successStates ?? [
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4178
|
+
RPCSPEC07.ETransactionExecutionStatus.SUCCEEDED,
|
|
4179
|
+
RPCSPEC07.ETransactionStatus.ACCEPTED_ON_L2,
|
|
4180
|
+
RPCSPEC07.ETransactionStatus.ACCEPTED_ON_L1
|
|
4282
4181
|
];
|
|
4283
4182
|
let txStatus;
|
|
4284
4183
|
while (!onchain) {
|
|
@@ -4363,7 +4262,7 @@ var RpcChannel2 = class {
|
|
|
4363
4262
|
let flags = {};
|
|
4364
4263
|
if (!isVersion("0.5", await this.getSpecVersion())) {
|
|
4365
4264
|
flags = {
|
|
4366
|
-
simulation_flags: skipValidate ? [
|
|
4265
|
+
simulation_flags: skipValidate ? [RPCSPEC07.ESimulationFlag.SKIP_VALIDATE] : []
|
|
4367
4266
|
};
|
|
4368
4267
|
}
|
|
4369
4268
|
return this.fetchEndpoint("starknet_estimateFee", {
|
|
@@ -4379,9 +4278,9 @@ var RpcChannel2 = class {
|
|
|
4379
4278
|
invoke_transaction: {
|
|
4380
4279
|
sender_address: functionInvocation.contractAddress,
|
|
4381
4280
|
calldata: CallData.toHex(functionInvocation.calldata),
|
|
4382
|
-
type:
|
|
4281
|
+
type: RPCSPEC07.ETransactionType.INVOKE,
|
|
4383
4282
|
max_fee: toHex(details.maxFee || 0),
|
|
4384
|
-
version:
|
|
4283
|
+
version: RPCSPEC07.ETransactionVersion.V1,
|
|
4385
4284
|
signature: signatureToHexArray(functionInvocation.signature),
|
|
4386
4285
|
nonce: toHex(details.nonce)
|
|
4387
4286
|
}
|
|
@@ -4389,10 +4288,10 @@ var RpcChannel2 = class {
|
|
|
4389
4288
|
} else {
|
|
4390
4289
|
promise = this.fetchEndpoint("starknet_addInvokeTransaction", {
|
|
4391
4290
|
invoke_transaction: {
|
|
4392
|
-
type:
|
|
4291
|
+
type: RPCSPEC07.ETransactionType.INVOKE,
|
|
4393
4292
|
sender_address: functionInvocation.contractAddress,
|
|
4394
4293
|
calldata: CallData.toHex(functionInvocation.calldata),
|
|
4395
|
-
version:
|
|
4294
|
+
version: RPCSPEC07.ETransactionVersion.V3,
|
|
4396
4295
|
signature: signatureToHexArray(functionInvocation.signature),
|
|
4397
4296
|
nonce: toHex(details.nonce),
|
|
4398
4297
|
resource_bounds: details.resourceBounds,
|
|
@@ -4411,13 +4310,13 @@ var RpcChannel2 = class {
|
|
|
4411
4310
|
if (!isSierra(contract) && !isV3Tx(details)) {
|
|
4412
4311
|
promise = this.fetchEndpoint("starknet_addDeclareTransaction", {
|
|
4413
4312
|
declare_transaction: {
|
|
4414
|
-
type:
|
|
4313
|
+
type: RPCSPEC07.ETransactionType.DECLARE,
|
|
4415
4314
|
contract_class: {
|
|
4416
4315
|
program: contract.program,
|
|
4417
4316
|
entry_points_by_type: contract.entry_points_by_type,
|
|
4418
4317
|
abi: contract.abi
|
|
4419
4318
|
},
|
|
4420
|
-
version:
|
|
4319
|
+
version: RPCSPEC07.ETransactionVersion.V1,
|
|
4421
4320
|
max_fee: toHex(details.maxFee || 0),
|
|
4422
4321
|
signature: signatureToHexArray(signature),
|
|
4423
4322
|
sender_address: senderAddress,
|
|
@@ -4427,7 +4326,7 @@ var RpcChannel2 = class {
|
|
|
4427
4326
|
} else if (isSierra(contract) && !isV3Tx(details)) {
|
|
4428
4327
|
promise = this.fetchEndpoint("starknet_addDeclareTransaction", {
|
|
4429
4328
|
declare_transaction: {
|
|
4430
|
-
type:
|
|
4329
|
+
type: RPCSPEC07.ETransactionType.DECLARE,
|
|
4431
4330
|
contract_class: {
|
|
4432
4331
|
sierra_program: decompressProgram(contract.sierra_program),
|
|
4433
4332
|
contract_class_version: contract.contract_class_version,
|
|
@@ -4435,7 +4334,7 @@ var RpcChannel2 = class {
|
|
|
4435
4334
|
abi: contract.abi
|
|
4436
4335
|
},
|
|
4437
4336
|
compiled_class_hash: compiledClassHash || "",
|
|
4438
|
-
version:
|
|
4337
|
+
version: RPCSPEC07.ETransactionVersion.V2,
|
|
4439
4338
|
max_fee: toHex(details.maxFee || 0),
|
|
4440
4339
|
signature: signatureToHexArray(signature),
|
|
4441
4340
|
sender_address: senderAddress,
|
|
@@ -4445,10 +4344,10 @@ var RpcChannel2 = class {
|
|
|
4445
4344
|
} else if (isSierra(contract) && isV3Tx(details)) {
|
|
4446
4345
|
promise = this.fetchEndpoint("starknet_addDeclareTransaction", {
|
|
4447
4346
|
declare_transaction: {
|
|
4448
|
-
type:
|
|
4347
|
+
type: RPCSPEC07.ETransactionType.DECLARE,
|
|
4449
4348
|
sender_address: senderAddress,
|
|
4450
4349
|
compiled_class_hash: compiledClassHash || "",
|
|
4451
|
-
version:
|
|
4350
|
+
version: RPCSPEC07.ETransactionVersion.V3,
|
|
4452
4351
|
signature: signatureToHexArray(signature),
|
|
4453
4352
|
nonce: toHex(details.nonce),
|
|
4454
4353
|
contract_class: {
|
|
@@ -4478,9 +4377,9 @@ var RpcChannel2 = class {
|
|
|
4478
4377
|
constructor_calldata: CallData.toHex(constructorCalldata || []),
|
|
4479
4378
|
class_hash: toHex(classHash),
|
|
4480
4379
|
contract_address_salt: toHex(addressSalt || 0),
|
|
4481
|
-
type:
|
|
4380
|
+
type: RPCSPEC07.ETransactionType.DEPLOY_ACCOUNT,
|
|
4482
4381
|
max_fee: toHex(details.maxFee || 0),
|
|
4483
|
-
version:
|
|
4382
|
+
version: RPCSPEC07.ETransactionVersion.V1,
|
|
4484
4383
|
signature: signatureToHexArray(signature),
|
|
4485
4384
|
nonce: toHex(details.nonce)
|
|
4486
4385
|
}
|
|
@@ -4488,8 +4387,8 @@ var RpcChannel2 = class {
|
|
|
4488
4387
|
} else {
|
|
4489
4388
|
promise = this.fetchEndpoint("starknet_addDeployAccountTransaction", {
|
|
4490
4389
|
deploy_account_transaction: {
|
|
4491
|
-
type:
|
|
4492
|
-
version:
|
|
4390
|
+
type: RPCSPEC07.ETransactionType.DEPLOY_ACCOUNT,
|
|
4391
|
+
version: RPCSPEC07.ETransactionVersion.V3,
|
|
4493
4392
|
signature: signatureToHexArray(signature),
|
|
4494
4393
|
nonce: toHex(details.nonce),
|
|
4495
4394
|
contract_address_salt: toHex(addressSalt || 0),
|
|
@@ -4572,8 +4471,7 @@ var RpcChannel2 = class {
|
|
|
4572
4471
|
if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) {
|
|
4573
4472
|
return {
|
|
4574
4473
|
// v0 v1 v3
|
|
4575
|
-
type:
|
|
4576
|
-
// TODO: Diff between sequencer and rpc invoke type
|
|
4474
|
+
type: RPCSPEC07.ETransactionType.INVOKE,
|
|
4577
4475
|
sender_address: invocation.contractAddress,
|
|
4578
4476
|
calldata: CallData.toHex(invocation.calldata),
|
|
4579
4477
|
version: toHex(invocation.version || defaultVersions.v3),
|
|
@@ -4689,6 +4587,9 @@ var RPCResponseParser = class {
|
|
|
4689
4587
|
abi: isString(res.abi) ? JSON.parse(res.abi) : res.abi
|
|
4690
4588
|
};
|
|
4691
4589
|
}
|
|
4590
|
+
parseL1GasPriceResponse(res) {
|
|
4591
|
+
return res.l1_gas_price.price_in_wei;
|
|
4592
|
+
}
|
|
4692
4593
|
};
|
|
4693
4594
|
|
|
4694
4595
|
// src/utils/transactionReceipt.ts
|
|
@@ -4787,6 +4688,9 @@ var RpcProvider = class {
|
|
|
4787
4688
|
async getBlockWithTxs(blockIdentifier) {
|
|
4788
4689
|
return this.channel.getBlockWithTxs(blockIdentifier);
|
|
4789
4690
|
}
|
|
4691
|
+
async getL1GasPrice(blockIdentifier) {
|
|
4692
|
+
return this.channel.getBlockWithTxHashes(blockIdentifier).then(this.responseParser.parseL1GasPriceResponse);
|
|
4693
|
+
}
|
|
4790
4694
|
async getBlockWithReceipts(blockIdentifier) {
|
|
4791
4695
|
if (this.channel instanceof rpc_0_6_exports.RpcChannel)
|
|
4792
4696
|
throw new LibraryError("Unsupported method for RPC version");
|
|
@@ -5437,7 +5341,7 @@ var SignerInterface = class {
|
|
|
5437
5341
|
// src/utils/typedData.ts
|
|
5438
5342
|
var typedData_exports = {};
|
|
5439
5343
|
__export(typedData_exports, {
|
|
5440
|
-
TypedDataRevision: () =>
|
|
5344
|
+
TypedDataRevision: () => import_starknet_types_07.TypedDataRevision,
|
|
5441
5345
|
encodeData: () => encodeData,
|
|
5442
5346
|
encodeType: () => encodeType,
|
|
5443
5347
|
encodeValue: () => encodeValue,
|
|
@@ -5541,14 +5445,14 @@ var presetTypes = {
|
|
|
5541
5445
|
)
|
|
5542
5446
|
};
|
|
5543
5447
|
var revisionConfiguration = {
|
|
5544
|
-
[
|
|
5448
|
+
[import_starknet_types_07.TypedDataRevision.Active]: {
|
|
5545
5449
|
domain: "StarknetDomain",
|
|
5546
5450
|
hashMethod: computePoseidonHashOnElements,
|
|
5547
5451
|
hashMerkleMethod: computePoseidonHash,
|
|
5548
5452
|
escapeTypeString: (s) => `"${s}"`,
|
|
5549
5453
|
presetTypes
|
|
5550
5454
|
},
|
|
5551
|
-
[
|
|
5455
|
+
[import_starknet_types_07.TypedDataRevision.Legacy]: {
|
|
5552
5456
|
domain: "StarkNetDomain",
|
|
5553
5457
|
hashMethod: computePedersenHashOnElements,
|
|
5554
5458
|
hashMerkleMethod: computePedersenHash,
|
|
@@ -5561,10 +5465,10 @@ function assertRange(data, type, { min, max }) {
|
|
|
5561
5465
|
assert(value >= min && value <= max, `${value} (${type}) is out of bounds [${min}, ${max}]`);
|
|
5562
5466
|
}
|
|
5563
5467
|
function identifyRevision({ types, domain }) {
|
|
5564
|
-
if (revisionConfiguration[
|
|
5565
|
-
return
|
|
5566
|
-
if (revisionConfiguration[
|
|
5567
|
-
return
|
|
5468
|
+
if (revisionConfiguration[import_starknet_types_07.TypedDataRevision.Active].domain in types && domain.revision === import_starknet_types_07.TypedDataRevision.Active)
|
|
5469
|
+
return import_starknet_types_07.TypedDataRevision.Active;
|
|
5470
|
+
if (revisionConfiguration[import_starknet_types_07.TypedDataRevision.Legacy].domain in types && (domain.revision ?? import_starknet_types_07.TypedDataRevision.Legacy) === import_starknet_types_07.TypedDataRevision.Legacy)
|
|
5471
|
+
return import_starknet_types_07.TypedDataRevision.Legacy;
|
|
5568
5472
|
return void 0;
|
|
5569
5473
|
}
|
|
5570
5474
|
function getHex(value) {
|
|
@@ -5589,10 +5493,10 @@ function prepareSelector(selector) {
|
|
|
5589
5493
|
function isMerkleTreeType(type) {
|
|
5590
5494
|
return type.type === "merkletree";
|
|
5591
5495
|
}
|
|
5592
|
-
function getDependencies(types, type, dependencies = [], contains = "", revision =
|
|
5496
|
+
function getDependencies(types, type, dependencies = [], contains = "", revision = import_starknet_types_07.TypedDataRevision.Legacy) {
|
|
5593
5497
|
if (type[type.length - 1] === "*") {
|
|
5594
5498
|
type = type.slice(0, -1);
|
|
5595
|
-
} else if (revision ===
|
|
5499
|
+
} else if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5596
5500
|
if (type === "enum") {
|
|
5597
5501
|
type = contains;
|
|
5598
5502
|
} else if (type.match(/^\(.*\)$/)) {
|
|
@@ -5630,8 +5534,8 @@ function getMerkleTreeType(types, ctx) {
|
|
|
5630
5534
|
}
|
|
5631
5535
|
return "raw";
|
|
5632
5536
|
}
|
|
5633
|
-
function encodeType(types, type, revision =
|
|
5634
|
-
const allTypes = revision ===
|
|
5537
|
+
function encodeType(types, type, revision = import_starknet_types_07.TypedDataRevision.Legacy) {
|
|
5538
|
+
const allTypes = revision === import_starknet_types_07.TypedDataRevision.Active ? { ...types, ...revisionConfiguration[revision].presetTypes } : types;
|
|
5635
5539
|
const [primary, ...dependencies] = getDependencies(
|
|
5636
5540
|
allTypes,
|
|
5637
5541
|
type,
|
|
@@ -5643,17 +5547,17 @@ function encodeType(types, type, revision = import_starknet_types.TypedDataRevis
|
|
|
5643
5547
|
const esc = revisionConfiguration[revision].escapeTypeString;
|
|
5644
5548
|
return newTypes.map((dependency) => {
|
|
5645
5549
|
const dependencyElements = allTypes[dependency].map((t) => {
|
|
5646
|
-
const targetType = t.type === "enum" && revision ===
|
|
5550
|
+
const targetType = t.type === "enum" && revision === import_starknet_types_07.TypedDataRevision.Active ? t.contains : t.type;
|
|
5647
5551
|
const typeString = targetType.match(/^\(.*\)$/) ? `(${targetType.slice(1, -1).split(",").map((e) => e ? esc(e) : e).join(",")})` : esc(targetType);
|
|
5648
5552
|
return `${esc(t.name)}:${typeString}`;
|
|
5649
5553
|
});
|
|
5650
5554
|
return `${esc(dependency)}(${dependencyElements})`;
|
|
5651
5555
|
}).join("");
|
|
5652
5556
|
}
|
|
5653
|
-
function getTypeHash(types, type, revision =
|
|
5557
|
+
function getTypeHash(types, type, revision = import_starknet_types_07.TypedDataRevision.Legacy) {
|
|
5654
5558
|
return getSelectorFromName(encodeType(types, type, revision));
|
|
5655
5559
|
}
|
|
5656
|
-
function encodeValue(types, type, data, ctx = {}, revision =
|
|
5560
|
+
function encodeValue(types, type, data, ctx = {}, revision = import_starknet_types_07.TypedDataRevision.Legacy) {
|
|
5657
5561
|
if (types[type]) {
|
|
5658
5562
|
return [type, getStructHash(types, type, data, revision)];
|
|
5659
5563
|
}
|
|
@@ -5676,7 +5580,7 @@ function encodeValue(types, type, data, ctx = {}, revision = import_starknet_typ
|
|
|
5676
5580
|
}
|
|
5677
5581
|
switch (type) {
|
|
5678
5582
|
case "enum": {
|
|
5679
|
-
if (revision ===
|
|
5583
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5680
5584
|
const [variantKey, variantData] = Object.entries(data)[0];
|
|
5681
5585
|
const parentType = types[ctx.parent][0];
|
|
5682
5586
|
const enumType = types[parentType.contains];
|
|
@@ -5710,7 +5614,7 @@ function encodeValue(types, type, data, ctx = {}, revision = import_starknet_typ
|
|
|
5710
5614
|
return ["felt", prepareSelector(data)];
|
|
5711
5615
|
}
|
|
5712
5616
|
case "string": {
|
|
5713
|
-
if (revision ===
|
|
5617
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5714
5618
|
const byteArray = byteArrayFromString(data);
|
|
5715
5619
|
const elements = [
|
|
5716
5620
|
byteArray.data.length,
|
|
@@ -5723,7 +5627,7 @@ function encodeValue(types, type, data, ctx = {}, revision = import_starknet_typ
|
|
|
5723
5627
|
return [type, getHex(data)];
|
|
5724
5628
|
}
|
|
5725
5629
|
case "i128": {
|
|
5726
|
-
if (revision ===
|
|
5630
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5727
5631
|
const value = BigInt(data);
|
|
5728
5632
|
assertRange(value, type, RANGE_I128);
|
|
5729
5633
|
return [type, getHex(value < 0n ? PRIME + value : value)];
|
|
@@ -5732,40 +5636,40 @@ function encodeValue(types, type, data, ctx = {}, revision = import_starknet_typ
|
|
|
5732
5636
|
}
|
|
5733
5637
|
case "timestamp":
|
|
5734
5638
|
case "u128": {
|
|
5735
|
-
if (revision ===
|
|
5639
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5736
5640
|
assertRange(data, type, RANGE_U128);
|
|
5737
5641
|
}
|
|
5738
5642
|
return [type, getHex(data)];
|
|
5739
5643
|
}
|
|
5740
5644
|
case "felt":
|
|
5741
5645
|
case "shortstring": {
|
|
5742
|
-
if (revision ===
|
|
5646
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5743
5647
|
assertRange(getHex(data), type, RANGE_FELT);
|
|
5744
5648
|
}
|
|
5745
5649
|
return [type, getHex(data)];
|
|
5746
5650
|
}
|
|
5747
5651
|
case "ClassHash":
|
|
5748
5652
|
case "ContractAddress": {
|
|
5749
|
-
if (revision ===
|
|
5653
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5750
5654
|
assertRange(data, type, RANGE_FELT);
|
|
5751
5655
|
}
|
|
5752
5656
|
return [type, getHex(data)];
|
|
5753
5657
|
}
|
|
5754
5658
|
case "bool": {
|
|
5755
|
-
if (revision ===
|
|
5659
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5756
5660
|
assert(typeof data === "boolean", `Type mismatch for ${type} ${data}`);
|
|
5757
5661
|
}
|
|
5758
5662
|
return [type, getHex(data)];
|
|
5759
5663
|
}
|
|
5760
5664
|
default: {
|
|
5761
|
-
if (revision ===
|
|
5665
|
+
if (revision === import_starknet_types_07.TypedDataRevision.Active) {
|
|
5762
5666
|
throw new Error(`Unsupported type: ${type}`);
|
|
5763
5667
|
}
|
|
5764
5668
|
return [type, getHex(data)];
|
|
5765
5669
|
}
|
|
5766
5670
|
}
|
|
5767
5671
|
}
|
|
5768
|
-
function encodeData(types, type, data, revision =
|
|
5672
|
+
function encodeData(types, type, data, revision = import_starknet_types_07.TypedDataRevision.Legacy) {
|
|
5769
5673
|
const targetType = types[type] ?? revisionConfiguration[revision].presetTypes[type];
|
|
5770
5674
|
const [returnTypes, values] = targetType.reduce(
|
|
5771
5675
|
([ts, vs], field) => {
|
|
@@ -5784,7 +5688,7 @@ function encodeData(types, type, data, revision = import_starknet_types.TypedDat
|
|
|
5784
5688
|
);
|
|
5785
5689
|
return [returnTypes, values];
|
|
5786
5690
|
}
|
|
5787
|
-
function getStructHash(types, type, data, revision =
|
|
5691
|
+
function getStructHash(types, type, data, revision = import_starknet_types_07.TypedDataRevision.Legacy) {
|
|
5788
5692
|
return revisionConfiguration[revision].hashMethod(encodeData(types, type, data, revision)[1]);
|
|
5789
5693
|
}
|
|
5790
5694
|
function getMessageHash(typedData, account) {
|
|
@@ -5818,7 +5722,7 @@ var Signer = class {
|
|
|
5818
5722
|
async signTransaction(transactions, details) {
|
|
5819
5723
|
const compiledCalldata = getExecuteCalldata(transactions, details.cairoVersion);
|
|
5820
5724
|
let msgHash;
|
|
5821
|
-
if (Object.values(
|
|
5725
|
+
if (Object.values(api_exports.ETransactionVersion2).includes(details.version)) {
|
|
5822
5726
|
const det = details;
|
|
5823
5727
|
msgHash = calculateInvokeTransactionHash2({
|
|
5824
5728
|
...det,
|
|
@@ -5826,7 +5730,7 @@ var Signer = class {
|
|
|
5826
5730
|
compiledCalldata,
|
|
5827
5731
|
version: det.version
|
|
5828
5732
|
});
|
|
5829
|
-
} else if (Object.values(
|
|
5733
|
+
} else if (Object.values(api_exports.ETransactionVersion3).includes(details.version)) {
|
|
5830
5734
|
const det = details;
|
|
5831
5735
|
msgHash = calculateInvokeTransactionHash2({
|
|
5832
5736
|
...det,
|
|
@@ -5844,7 +5748,7 @@ var Signer = class {
|
|
|
5844
5748
|
async signDeployAccountTransaction(details) {
|
|
5845
5749
|
const compiledConstructorCalldata = CallData.compile(details.constructorCalldata);
|
|
5846
5750
|
let msgHash;
|
|
5847
|
-
if (Object.values(
|
|
5751
|
+
if (Object.values(api_exports.ETransactionVersion2).includes(details.version)) {
|
|
5848
5752
|
const det = details;
|
|
5849
5753
|
msgHash = calculateDeployAccountTransactionHash3({
|
|
5850
5754
|
...det,
|
|
@@ -5852,7 +5756,7 @@ var Signer = class {
|
|
|
5852
5756
|
constructorCalldata: compiledConstructorCalldata,
|
|
5853
5757
|
version: det.version
|
|
5854
5758
|
});
|
|
5855
|
-
} else if (Object.values(
|
|
5759
|
+
} else if (Object.values(api_exports.ETransactionVersion3).includes(details.version)) {
|
|
5856
5760
|
const det = details;
|
|
5857
5761
|
msgHash = calculateDeployAccountTransactionHash3({
|
|
5858
5762
|
...det,
|
|
@@ -5869,13 +5773,13 @@ var Signer = class {
|
|
|
5869
5773
|
}
|
|
5870
5774
|
async signDeclareTransaction(details) {
|
|
5871
5775
|
let msgHash;
|
|
5872
|
-
if (Object.values(
|
|
5776
|
+
if (Object.values(api_exports.ETransactionVersion2).includes(details.version)) {
|
|
5873
5777
|
const det = details;
|
|
5874
5778
|
msgHash = calculateDeclareTransactionHash3({
|
|
5875
5779
|
...det,
|
|
5876
5780
|
version: det.version
|
|
5877
5781
|
});
|
|
5878
|
-
} else if (Object.values(
|
|
5782
|
+
} else if (Object.values(api_exports.ETransactionVersion3).includes(details.version)) {
|
|
5879
5783
|
const det = details;
|
|
5880
5784
|
msgHash = calculateDeclareTransactionHash3({
|
|
5881
5785
|
...det,
|
|
@@ -5942,7 +5846,7 @@ var EthSigner = class {
|
|
|
5942
5846
|
async signTransaction(transactions, details) {
|
|
5943
5847
|
const compiledCalldata = getExecuteCalldata(transactions, details.cairoVersion);
|
|
5944
5848
|
let msgHash;
|
|
5945
|
-
if (Object.values(
|
|
5849
|
+
if (Object.values(api_exports.ETransactionVersion2).includes(details.version)) {
|
|
5946
5850
|
const det = details;
|
|
5947
5851
|
msgHash = calculateInvokeTransactionHash2({
|
|
5948
5852
|
...det,
|
|
@@ -5950,7 +5854,7 @@ var EthSigner = class {
|
|
|
5950
5854
|
compiledCalldata,
|
|
5951
5855
|
version: det.version
|
|
5952
5856
|
});
|
|
5953
|
-
} else if (Object.values(
|
|
5857
|
+
} else if (Object.values(api_exports.ETransactionVersion3).includes(details.version)) {
|
|
5954
5858
|
const det = details;
|
|
5955
5859
|
msgHash = calculateInvokeTransactionHash2({
|
|
5956
5860
|
...det,
|
|
@@ -5972,7 +5876,7 @@ var EthSigner = class {
|
|
|
5972
5876
|
async signDeployAccountTransaction(details) {
|
|
5973
5877
|
const compiledConstructorCalldata = CallData.compile(details.constructorCalldata);
|
|
5974
5878
|
let msgHash;
|
|
5975
|
-
if (Object.values(
|
|
5879
|
+
if (Object.values(api_exports.ETransactionVersion2).includes(details.version)) {
|
|
5976
5880
|
const det = details;
|
|
5977
5881
|
msgHash = calculateDeployAccountTransactionHash3({
|
|
5978
5882
|
...det,
|
|
@@ -5980,7 +5884,7 @@ var EthSigner = class {
|
|
|
5980
5884
|
constructorCalldata: compiledConstructorCalldata,
|
|
5981
5885
|
version: det.version
|
|
5982
5886
|
});
|
|
5983
|
-
} else if (Object.values(
|
|
5887
|
+
} else if (Object.values(api_exports.ETransactionVersion3).includes(details.version)) {
|
|
5984
5888
|
const det = details;
|
|
5985
5889
|
msgHash = calculateDeployAccountTransactionHash3({
|
|
5986
5890
|
...det,
|
|
@@ -6001,13 +5905,13 @@ var EthSigner = class {
|
|
|
6001
5905
|
}
|
|
6002
5906
|
async signDeclareTransaction(details) {
|
|
6003
5907
|
let msgHash;
|
|
6004
|
-
if (Object.values(
|
|
5908
|
+
if (Object.values(api_exports.ETransactionVersion2).includes(details.version)) {
|
|
6005
5909
|
const det = details;
|
|
6006
5910
|
msgHash = calculateDeclareTransactionHash3({
|
|
6007
5911
|
...det,
|
|
6008
5912
|
version: det.version
|
|
6009
5913
|
});
|
|
6010
|
-
} else if (Object.values(
|
|
5914
|
+
} else if (Object.values(api_exports.ETransactionVersion3).includes(details.version)) {
|
|
6011
5915
|
const det = details;
|
|
6012
5916
|
msgHash = calculateDeclareTransactionHash3({
|
|
6013
5917
|
...det,
|
|
@@ -6071,7 +5975,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6071
5975
|
address;
|
|
6072
5976
|
cairoVersion;
|
|
6073
5977
|
transactionVersion;
|
|
6074
|
-
constructor(providerOrOptions, address, pkOrSigner, cairoVersion, transactionVersion =
|
|
5978
|
+
constructor(providerOrOptions, address, pkOrSigner, cairoVersion, transactionVersion = api_exports.ETransactionVersion.V2) {
|
|
6075
5979
|
super(providerOrOptions);
|
|
6076
5980
|
this.address = address.toLowerCase();
|
|
6077
5981
|
this.signer = isString(pkOrSigner) || pkOrSigner instanceof Uint8Array ? new Signer(pkOrSigner) : pkOrSigner;
|
|
@@ -6082,11 +5986,11 @@ var Account = class extends RpcProvider2 {
|
|
|
6082
5986
|
}
|
|
6083
5987
|
// provided version or contract based preferred transactionVersion
|
|
6084
5988
|
getPreferredVersion(type12, type3) {
|
|
6085
|
-
if (this.transactionVersion ===
|
|
5989
|
+
if (this.transactionVersion === api_exports.ETransactionVersion.V3)
|
|
6086
5990
|
return type3;
|
|
6087
|
-
if (this.transactionVersion ===
|
|
5991
|
+
if (this.transactionVersion === api_exports.ETransactionVersion.V2)
|
|
6088
5992
|
return type12;
|
|
6089
|
-
return
|
|
5993
|
+
return api_exports.ETransactionVersion.V3;
|
|
6090
5994
|
}
|
|
6091
5995
|
async getNonce(blockIdentifier) {
|
|
6092
5996
|
return super.getNonceForAddress(this.address, blockIdentifier);
|
|
@@ -6122,7 +6026,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6122
6026
|
const transactions = Array.isArray(calls) ? calls : [calls];
|
|
6123
6027
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
6124
6028
|
const version = toTransactionVersion(
|
|
6125
|
-
this.getPreferredVersion(
|
|
6029
|
+
this.getPreferredVersion(api_exports.ETransactionVersion.F1, api_exports.ETransactionVersion.F3),
|
|
6126
6030
|
toFeeVersion(providedVersion)
|
|
6127
6031
|
);
|
|
6128
6032
|
const chainId = await this.getChainId();
|
|
@@ -6153,7 +6057,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6153
6057
|
} = details;
|
|
6154
6058
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
6155
6059
|
const version = toTransactionVersion(
|
|
6156
|
-
!isSierra(payload.contract) ?
|
|
6060
|
+
!isSierra(payload.contract) ? api_exports.ETransactionVersion.F1 : this.getPreferredVersion(api_exports.ETransactionVersion.F2, api_exports.ETransactionVersion.F3),
|
|
6157
6061
|
toFeeVersion(providedVersion)
|
|
6158
6062
|
);
|
|
6159
6063
|
const chainId = await this.getChainId();
|
|
@@ -6183,7 +6087,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6183
6087
|
}, details = {}) {
|
|
6184
6088
|
const { blockIdentifier, version: providedVersion, skipValidate = true } = details;
|
|
6185
6089
|
const version = toTransactionVersion(
|
|
6186
|
-
this.getPreferredVersion(
|
|
6090
|
+
this.getPreferredVersion(api_exports.ETransactionVersion.F1, api_exports.ETransactionVersion.F3),
|
|
6187
6091
|
toFeeVersion(providedVersion)
|
|
6188
6092
|
);
|
|
6189
6093
|
const nonce = ZERO;
|
|
@@ -6219,10 +6123,10 @@ var Account = class extends RpcProvider2 {
|
|
|
6219
6123
|
const accountInvocations = await this.accountInvocationsFactory(invocations, {
|
|
6220
6124
|
...v3Details(details),
|
|
6221
6125
|
versions: [
|
|
6222
|
-
|
|
6126
|
+
api_exports.ETransactionVersion.F1,
|
|
6223
6127
|
// non-sierra
|
|
6224
6128
|
toTransactionVersion(
|
|
6225
|
-
this.getPreferredVersion(
|
|
6129
|
+
this.getPreferredVersion(api_exports.ETransactionVersion.F2, api_exports.ETransactionVersion.F3),
|
|
6226
6130
|
version
|
|
6227
6131
|
)
|
|
6228
6132
|
// sierra
|
|
@@ -6241,10 +6145,10 @@ var Account = class extends RpcProvider2 {
|
|
|
6241
6145
|
const accountInvocations = await this.accountInvocationsFactory(invocations, {
|
|
6242
6146
|
...v3Details(details),
|
|
6243
6147
|
versions: [
|
|
6244
|
-
|
|
6148
|
+
api_exports.ETransactionVersion.V1,
|
|
6245
6149
|
// non-sierra
|
|
6246
6150
|
toTransactionVersion(
|
|
6247
|
-
this.getPreferredVersion(
|
|
6151
|
+
this.getPreferredVersion(api_exports.ETransactionVersion.V2, api_exports.ETransactionVersion.V3),
|
|
6248
6152
|
version
|
|
6249
6153
|
)
|
|
6250
6154
|
],
|
|
@@ -6263,7 +6167,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6263
6167
|
const calls = Array.isArray(transactions) ? transactions : [transactions];
|
|
6264
6168
|
const nonce = toBigInt(details.nonce ?? await this.getNonce());
|
|
6265
6169
|
const version = toTransactionVersion(
|
|
6266
|
-
this.getPreferredVersion(
|
|
6170
|
+
this.getPreferredVersion(api_exports.ETransactionVersion.V1, api_exports.ETransactionVersion.V3),
|
|
6267
6171
|
// TODO: does this depend on cairo version ?
|
|
6268
6172
|
details.version
|
|
6269
6173
|
);
|
|
@@ -6321,7 +6225,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6321
6225
|
const declareContractPayload = extractContractHashes(payload);
|
|
6322
6226
|
const { nonce, version: providedVersion } = details;
|
|
6323
6227
|
const version = toTransactionVersion(
|
|
6324
|
-
!isSierra(payload.contract) ?
|
|
6228
|
+
!isSierra(payload.contract) ? api_exports.ETransactionVersion.V1 : this.getPreferredVersion(api_exports.ETransactionVersion.V2, api_exports.ETransactionVersion.V3),
|
|
6325
6229
|
providedVersion
|
|
6326
6230
|
);
|
|
6327
6231
|
const estimate = await this.getUniversalSuggestedFee(
|
|
@@ -6385,7 +6289,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6385
6289
|
contractAddress: providedContractAddress
|
|
6386
6290
|
}, details = {}) {
|
|
6387
6291
|
const version = toTransactionVersion(
|
|
6388
|
-
this.getPreferredVersion(
|
|
6292
|
+
this.getPreferredVersion(api_exports.ETransactionVersion.V1, api_exports.ETransactionVersion.V3),
|
|
6389
6293
|
details.version
|
|
6390
6294
|
);
|
|
6391
6295
|
const nonce = ZERO;
|
|
@@ -6467,7 +6371,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6467
6371
|
async getUniversalSuggestedFee(version, { type, payload }, details) {
|
|
6468
6372
|
let maxFee = 0;
|
|
6469
6373
|
let resourceBounds = estimateFeeToBounds(ZERO);
|
|
6470
|
-
if (version ===
|
|
6374
|
+
if (version === api_exports.ETransactionVersion.V3) {
|
|
6471
6375
|
resourceBounds = details.resourceBounds ?? (await this.getSuggestedFee({ type, payload }, details)).resourceBounds;
|
|
6472
6376
|
} else {
|
|
6473
6377
|
maxFee = details.maxFee ?? (await this.getSuggestedFee({ type, payload }, details)).suggestedMaxFee;
|
|
@@ -6520,7 +6424,7 @@ var Account = class extends RpcProvider2 {
|
|
|
6520
6424
|
async buildDeclarePayload(payload, details) {
|
|
6521
6425
|
const { classHash, contract, compiledClassHash } = extractContractHashes(payload);
|
|
6522
6426
|
const compressedCompiledContract = parseContract(contract);
|
|
6523
|
-
if (typeof compiledClassHash === "undefined" && (details.version ===
|
|
6427
|
+
if (typeof compiledClassHash === "undefined" && (details.version === api_exports.ETransactionVersion3.F3 || details.version === api_exports.ETransactionVersion3.V3)) {
|
|
6524
6428
|
throw Error("V3 Transaction work with Cairo1 Contracts and require compiledClassHash");
|
|
6525
6429
|
}
|
|
6526
6430
|
const signature = !details.skipValidate ? await this.signer.signDeclareTransaction({
|
|
@@ -6673,7 +6577,6 @@ var AccountInterface = class extends ProviderInterface {
|
|
|
6673
6577
|
var connect_exports = {};
|
|
6674
6578
|
__export(connect_exports, {
|
|
6675
6579
|
addDeclareTransaction: () => addDeclareTransaction,
|
|
6676
|
-
addDeployAccountTransaction: () => addDeployAccountTransaction,
|
|
6677
6580
|
addInvokeTransaction: () => addInvokeTransaction,
|
|
6678
6581
|
addStarknetChain: () => addStarknetChain,
|
|
6679
6582
|
deploymentData: () => deploymentData,
|
|
@@ -6687,11 +6590,11 @@ __export(connect_exports, {
|
|
|
6687
6590
|
switchStarknetChain: () => switchStarknetChain,
|
|
6688
6591
|
watchAsset: () => watchAsset
|
|
6689
6592
|
});
|
|
6690
|
-
function requestAccounts(swo,
|
|
6593
|
+
function requestAccounts(swo, silent_mode = false) {
|
|
6691
6594
|
return swo.request({
|
|
6692
6595
|
type: "wallet_requestAccounts",
|
|
6693
6596
|
params: {
|
|
6694
|
-
|
|
6597
|
+
silent_mode
|
|
6695
6598
|
}
|
|
6696
6599
|
});
|
|
6697
6600
|
}
|
|
@@ -6726,30 +6629,24 @@ function deploymentData(swo) {
|
|
|
6726
6629
|
}
|
|
6727
6630
|
function addInvokeTransaction(swo, params) {
|
|
6728
6631
|
return swo.request({
|
|
6729
|
-
type: "
|
|
6632
|
+
type: "wallet_addInvokeTransaction",
|
|
6730
6633
|
params
|
|
6731
6634
|
});
|
|
6732
6635
|
}
|
|
6733
6636
|
function addDeclareTransaction(swo, params) {
|
|
6734
6637
|
return swo.request({
|
|
6735
|
-
type: "
|
|
6736
|
-
params
|
|
6737
|
-
});
|
|
6738
|
-
}
|
|
6739
|
-
function addDeployAccountTransaction(swo, params) {
|
|
6740
|
-
return swo.request({
|
|
6741
|
-
type: "starknet_addDeployAccountTransaction",
|
|
6638
|
+
type: "wallet_addDeclareTransaction",
|
|
6742
6639
|
params
|
|
6743
6640
|
});
|
|
6744
6641
|
}
|
|
6745
6642
|
function signMessage(swo, typedData) {
|
|
6746
6643
|
return swo.request({
|
|
6747
|
-
type: "
|
|
6644
|
+
type: "wallet_signTypedData",
|
|
6748
6645
|
params: typedData
|
|
6749
6646
|
});
|
|
6750
6647
|
}
|
|
6751
6648
|
function supportedSpecs(swo) {
|
|
6752
|
-
return swo.request({ type: "
|
|
6649
|
+
return swo.request({ type: "wallet_supportedSpecs" });
|
|
6753
6650
|
}
|
|
6754
6651
|
function onAccountChange(swo, callback) {
|
|
6755
6652
|
swo.on("accountsChanged", callback);
|
|
@@ -6778,7 +6675,7 @@ var WalletAccount = class extends Account {
|
|
|
6778
6675
|
walletProvider.request({
|
|
6779
6676
|
type: "wallet_requestAccounts",
|
|
6780
6677
|
params: {
|
|
6781
|
-
|
|
6678
|
+
silent_mode: false
|
|
6782
6679
|
}
|
|
6783
6680
|
}).then((res) => {
|
|
6784
6681
|
this.address = res[0].toLowerCase();
|
|
@@ -6819,7 +6716,7 @@ var WalletAccount = class extends Account {
|
|
|
6819
6716
|
const { contractAddress, entrypoint, calldata } = it;
|
|
6820
6717
|
return {
|
|
6821
6718
|
contract_address: contractAddress,
|
|
6822
|
-
entrypoint,
|
|
6719
|
+
entry_point: entrypoint,
|
|
6823
6720
|
calldata
|
|
6824
6721
|
};
|
|
6825
6722
|
});
|
|
@@ -6852,14 +6749,6 @@ var WalletAccount = class extends Account {
|
|
|
6852
6749
|
contract_address: addresses
|
|
6853
6750
|
};
|
|
6854
6751
|
}
|
|
6855
|
-
deployAccount(payload) {
|
|
6856
|
-
const params = {
|
|
6857
|
-
contract_address_salt: payload.addressSalt?.toString() || "0",
|
|
6858
|
-
constructor_calldata: payload.constructorCalldata ? CallData.compile(payload.constructorCalldata) : [],
|
|
6859
|
-
class_hash: payload.classHash
|
|
6860
|
-
};
|
|
6861
|
-
return addDeployAccountTransaction(this.walletProvider, params);
|
|
6862
|
-
}
|
|
6863
6752
|
signMessage(typedData) {
|
|
6864
6753
|
return signMessage(this.walletProvider, typedData);
|
|
6865
6754
|
}
|
|
@@ -7395,6 +7284,7 @@ var number = num_exports;
|
|
|
7395
7284
|
merkle,
|
|
7396
7285
|
num,
|
|
7397
7286
|
number,
|
|
7287
|
+
parseCalldataField,
|
|
7398
7288
|
parseUDCEvent,
|
|
7399
7289
|
provider,
|
|
7400
7290
|
selector,
|