starknet 5.3.0 → 5.4.1
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 +17 -0
- package/dist/index.d.ts +65 -41
- package/dist/index.global.js +842 -1991
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +95 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -57
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -3
package/dist/index.mjs
CHANGED
|
@@ -2444,24 +2444,22 @@ import * as weierstrass from "@noble/curves/abstract/weierstrass";
|
|
|
2444
2444
|
// src/utils/json.ts
|
|
2445
2445
|
var json_exports = {};
|
|
2446
2446
|
__export(json_exports, {
|
|
2447
|
-
|
|
2448
|
-
parse: () => parse,
|
|
2447
|
+
parse: () => parse2,
|
|
2449
2448
|
parseAlwaysAsBig: () => parseAlwaysAsBig,
|
|
2450
|
-
stringify: () =>
|
|
2449
|
+
stringify: () => stringify2,
|
|
2451
2450
|
stringifyAlwaysAsBig: () => stringifyAlwaysAsBig
|
|
2452
2451
|
});
|
|
2453
|
-
import
|
|
2454
|
-
var
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
constructorAction: "preserve"
|
|
2460
|
-
});
|
|
2452
|
+
import * as json from "lossless-json";
|
|
2453
|
+
var parseIntAsNumberOrBigInt = (x) => {
|
|
2454
|
+
if (!json.isInteger(x))
|
|
2455
|
+
return parseFloat(x);
|
|
2456
|
+
const v = parseInt(x, 10);
|
|
2457
|
+
return Number.isSafeInteger(v) ? v : BigInt(x);
|
|
2461
2458
|
};
|
|
2462
|
-
var
|
|
2463
|
-
var
|
|
2464
|
-
var
|
|
2459
|
+
var parse2 = (x) => json.parse(String(x), null, parseIntAsNumberOrBigInt);
|
|
2460
|
+
var parseAlwaysAsBig = (x) => json.parse(String(x), null, json.parseNumberAndBigInt);
|
|
2461
|
+
var stringify2 = (...p) => json.stringify(...p);
|
|
2462
|
+
var stringifyAlwaysAsBig = stringify2;
|
|
2465
2463
|
|
|
2466
2464
|
// src/utils/hash.ts
|
|
2467
2465
|
import * as poseidon from "@noble/curves/abstract/poseidon";
|
|
@@ -2595,11 +2593,11 @@ function formatSpaces(json2) {
|
|
|
2595
2593
|
function computeHintedClassHash(compiledContract) {
|
|
2596
2594
|
const { abi, program } = compiledContract;
|
|
2597
2595
|
const contractClass = { abi, program };
|
|
2598
|
-
const serializedJson = formatSpaces(
|
|
2596
|
+
const serializedJson = formatSpaces(stringify2(contractClass, nullSkipReplacer));
|
|
2599
2597
|
return addHexPrefix(starkCurve.keccak(utf8ToArray(serializedJson)).toString(16));
|
|
2600
2598
|
}
|
|
2601
2599
|
function computeLegacyContractClassHash(contract) {
|
|
2602
|
-
const compiledContract = typeof contract === "string" ?
|
|
2600
|
+
const compiledContract = typeof contract === "string" ? parse2(contract) : contract;
|
|
2603
2601
|
const apiVersion = toHex(API_VERSION);
|
|
2604
2602
|
const externalEntryPointsHash = computeHashOnElements(
|
|
2605
2603
|
compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset])
|
|
@@ -2662,7 +2660,7 @@ function hashEntryPointSierra(data) {
|
|
|
2662
2660
|
return poseidonHashMany(base);
|
|
2663
2661
|
}
|
|
2664
2662
|
function hashAbi(sierra) {
|
|
2665
|
-
const indentString = formatSpaces(
|
|
2663
|
+
const indentString = formatSpaces(stringify2(sierra.abi, null));
|
|
2666
2664
|
return BigInt(addHexPrefix(starkCurve.keccak(utf8ToArray(indentString)).toString(16)));
|
|
2667
2665
|
}
|
|
2668
2666
|
function computeSierraContractClassHash(sierra) {
|
|
@@ -2685,7 +2683,7 @@ function computeSierraContractClassHash(sierra) {
|
|
|
2685
2683
|
);
|
|
2686
2684
|
}
|
|
2687
2685
|
function computeContractClassHash(contract) {
|
|
2688
|
-
const compiledContract = typeof contract === "string" ?
|
|
2686
|
+
const compiledContract = typeof contract === "string" ? parse2(contract) : contract;
|
|
2689
2687
|
if ("sierra_program" in compiledContract) {
|
|
2690
2688
|
return computeSierraContractClassHash(compiledContract);
|
|
2691
2689
|
}
|
|
@@ -2693,7 +2691,6 @@ function computeContractClassHash(contract) {
|
|
|
2693
2691
|
}
|
|
2694
2692
|
|
|
2695
2693
|
// src/utils/contract.ts
|
|
2696
|
-
import { parse as parse2 } from "json-bigint";
|
|
2697
2694
|
function isSierra(contract) {
|
|
2698
2695
|
const compiledContract = typeof contract === "string" ? parse2(contract) : contract;
|
|
2699
2696
|
return "sierra_program" in compiledContract;
|
|
@@ -2723,15 +2720,14 @@ __export(stark_exports, {
|
|
|
2723
2720
|
estimatedFeeToMaxFee: () => estimatedFeeToMaxFee,
|
|
2724
2721
|
formatSignature: () => formatSignature,
|
|
2725
2722
|
makeAddress: () => makeAddress,
|
|
2726
|
-
parseSignature: () => parseSignature,
|
|
2727
2723
|
randomAddress: () => randomAddress,
|
|
2728
2724
|
signatureToDecimalArray: () => signatureToDecimalArray,
|
|
2729
2725
|
signatureToHexArray: () => signatureToHexArray
|
|
2730
2726
|
});
|
|
2731
|
-
import {
|
|
2727
|
+
import { getStarkKey, utils } from "micro-starknet";
|
|
2732
2728
|
import { gzip } from "pako";
|
|
2733
2729
|
function compressProgram(jsonProgram) {
|
|
2734
|
-
const stringified = typeof jsonProgram === "string" ? jsonProgram :
|
|
2730
|
+
const stringified = typeof jsonProgram === "string" ? jsonProgram : stringify2(jsonProgram);
|
|
2735
2731
|
const compressedProgram = gzip(stringified);
|
|
2736
2732
|
return btoaUniversal(compressedProgram);
|
|
2737
2733
|
}
|
|
@@ -2744,12 +2740,15 @@ function makeAddress(input) {
|
|
|
2744
2740
|
}
|
|
2745
2741
|
function formatSignature(sig) {
|
|
2746
2742
|
if (!sig)
|
|
2747
|
-
|
|
2743
|
+
throw Error("formatSignature: provided signature is undefined");
|
|
2744
|
+
if (Array.isArray(sig)) {
|
|
2745
|
+
return sig.map((it) => toHex(it));
|
|
2746
|
+
}
|
|
2748
2747
|
try {
|
|
2749
2748
|
const { r, s } = sig;
|
|
2750
2749
|
return [toHex(r), toHex(s)];
|
|
2751
2750
|
} catch (e) {
|
|
2752
|
-
|
|
2751
|
+
throw new Error("Signature need to be weierstrass.SignatureType or an array for custom");
|
|
2753
2752
|
}
|
|
2754
2753
|
}
|
|
2755
2754
|
function signatureToDecimalArray(sig) {
|
|
@@ -2758,12 +2757,6 @@ function signatureToDecimalArray(sig) {
|
|
|
2758
2757
|
function signatureToHexArray(sig) {
|
|
2759
2758
|
return bigNumberishArrayToHexadecimalStringArray(formatSignature(sig));
|
|
2760
2759
|
}
|
|
2761
|
-
function parseSignature(sig) {
|
|
2762
|
-
if (!sig)
|
|
2763
|
-
return void 0;
|
|
2764
|
-
const [r, s] = sig;
|
|
2765
|
-
return new Signature(toBigInt(r), toBigInt(s));
|
|
2766
|
-
}
|
|
2767
2760
|
function compileCalldata(args) {
|
|
2768
2761
|
const compiledData = Object.values(args).flatMap((value) => {
|
|
2769
2762
|
if (Array.isArray(value))
|
|
@@ -2801,13 +2794,13 @@ function parseCalldata(calldata = []) {
|
|
|
2801
2794
|
function createSierraContractClass(contract) {
|
|
2802
2795
|
const result = { ...contract };
|
|
2803
2796
|
delete result.sierra_program_debug_info;
|
|
2804
|
-
result.abi = formatSpaces(
|
|
2805
|
-
result.sierra_program = formatSpaces(
|
|
2797
|
+
result.abi = formatSpaces(stringify2(contract.abi));
|
|
2798
|
+
result.sierra_program = formatSpaces(stringify2(contract.sierra_program));
|
|
2806
2799
|
result.sierra_program = compressProgram(result.sierra_program);
|
|
2807
2800
|
return result;
|
|
2808
2801
|
}
|
|
2809
2802
|
function parseContract(contract) {
|
|
2810
|
-
const parsedContract = typeof contract === "string" ?
|
|
2803
|
+
const parsedContract = typeof contract === "string" ? parse2(contract) : contract;
|
|
2811
2804
|
if (!isSierra(contract)) {
|
|
2812
2805
|
return {
|
|
2813
2806
|
...parsedContract,
|
|
@@ -2857,7 +2850,7 @@ var RPCResponseParser = class {
|
|
|
2857
2850
|
};
|
|
2858
2851
|
|
|
2859
2852
|
// src/provider/errors.ts
|
|
2860
|
-
import { CustomError } from "ts-custom-error";
|
|
2853
|
+
import { CustomError } from "ts-custom-error/dist/custom-error";
|
|
2861
2854
|
var LibraryError = class extends CustomError {
|
|
2862
2855
|
};
|
|
2863
2856
|
var GatewayError = class extends LibraryError {
|
|
@@ -3079,7 +3072,7 @@ var RpcProvider = class {
|
|
|
3079
3072
|
fetch(method, params) {
|
|
3080
3073
|
return fetchPonyfill_default(this.nodeUrl, {
|
|
3081
3074
|
method: "POST",
|
|
3082
|
-
body:
|
|
3075
|
+
body: stringify2({ method, jsonrpc: "2.0", params, id: 0 }),
|
|
3083
3076
|
headers: this.headers
|
|
3084
3077
|
});
|
|
3085
3078
|
}
|
|
@@ -3398,7 +3391,7 @@ var SequencerAPIResponseParser = class extends ResponseParser {
|
|
|
3398
3391
|
max_fee: "max_fee" in res.transaction ? res.transaction.max_fee : void 0,
|
|
3399
3392
|
nonce: res.transaction.nonce,
|
|
3400
3393
|
sender_address: "sender_address" in res.transaction ? res.transaction.sender_address : void 0,
|
|
3401
|
-
signature: "signature" in res.transaction ?
|
|
3394
|
+
signature: "signature" in res.transaction ? res.transaction.signature : void 0,
|
|
3402
3395
|
transaction_hash: "transaction_hash" in res.transaction ? res.transaction.transaction_hash : void 0,
|
|
3403
3396
|
version: "version" in res.transaction ? res.transaction.version : void 0
|
|
3404
3397
|
};
|
|
@@ -3666,20 +3659,20 @@ var SequencerProvider = class {
|
|
|
3666
3659
|
try {
|
|
3667
3660
|
const response = await fetchPonyfill_default(url, {
|
|
3668
3661
|
method,
|
|
3669
|
-
body:
|
|
3662
|
+
body: stringify2(options == null ? void 0 : options.body),
|
|
3670
3663
|
headers
|
|
3671
3664
|
});
|
|
3672
3665
|
const textResponse = await response.text();
|
|
3673
3666
|
if (!response.ok) {
|
|
3674
3667
|
let responseBody;
|
|
3675
3668
|
try {
|
|
3676
|
-
responseBody =
|
|
3669
|
+
responseBody = parse2(textResponse);
|
|
3677
3670
|
} catch {
|
|
3678
3671
|
throw new HttpError(response.statusText, response.status);
|
|
3679
3672
|
}
|
|
3680
3673
|
throw new GatewayError(responseBody.message, responseBody.code);
|
|
3681
3674
|
}
|
|
3682
|
-
const parseChoice = (options == null ? void 0 : options.parseAlwaysAsBigInt) ? parseAlwaysAsBig :
|
|
3675
|
+
const parseChoice = (options == null ? void 0 : options.parseAlwaysAsBigInt) ? parseAlwaysAsBig : parse2;
|
|
3683
3676
|
return parseChoice(textResponse);
|
|
3684
3677
|
} catch (error) {
|
|
3685
3678
|
if (error instanceof Error && !(error instanceof LibraryError))
|
|
@@ -4748,7 +4741,10 @@ var transaction_exports = {};
|
|
|
4748
4741
|
__export(transaction_exports, {
|
|
4749
4742
|
fromCallsToExecuteCalldata: () => fromCallsToExecuteCalldata,
|
|
4750
4743
|
fromCallsToExecuteCalldataWithNonce: () => fromCallsToExecuteCalldataWithNonce,
|
|
4751
|
-
|
|
4744
|
+
fromCallsToExecuteCalldata_cairo1: () => fromCallsToExecuteCalldata_cairo1,
|
|
4745
|
+
getExecuteCalldata: () => getExecuteCalldata,
|
|
4746
|
+
transformCallsToMulticallArrays: () => transformCallsToMulticallArrays,
|
|
4747
|
+
transformCallsToMulticallArrays_cairo1: () => transformCallsToMulticallArrays_cairo1
|
|
4752
4748
|
});
|
|
4753
4749
|
var transformCallsToMulticallArrays = (calls) => {
|
|
4754
4750
|
const callArray = [];
|
|
@@ -4782,6 +4778,27 @@ var fromCallsToExecuteCalldata = (calls) => {
|
|
|
4782
4778
|
var fromCallsToExecuteCalldataWithNonce = (calls, nonce) => {
|
|
4783
4779
|
return [...fromCallsToExecuteCalldata(calls), toBigInt(nonce).toString()];
|
|
4784
4780
|
};
|
|
4781
|
+
var transformCallsToMulticallArrays_cairo1 = (calls) => {
|
|
4782
|
+
const callArray = calls.map((call) => ({
|
|
4783
|
+
to: toBigInt(call.contractAddress).toString(10),
|
|
4784
|
+
selector: toBigInt(getSelectorFromName(call.entrypoint)).toString(10),
|
|
4785
|
+
calldata: bigNumberishArrayToDecimalStringArray(call.calldata || [])
|
|
4786
|
+
}));
|
|
4787
|
+
return callArray;
|
|
4788
|
+
};
|
|
4789
|
+
var fromCallsToExecuteCalldata_cairo1 = (calls) => {
|
|
4790
|
+
const callArray = transformCallsToMulticallArrays_cairo1(calls);
|
|
4791
|
+
return [
|
|
4792
|
+
callArray.length.toString(),
|
|
4793
|
+
...callArray.map(({ to, selector, calldata }) => [to, selector, calldata.length.toString(), ...calldata]).flat()
|
|
4794
|
+
];
|
|
4795
|
+
};
|
|
4796
|
+
var getExecuteCalldata = (calls, cairoVersion = "0") => {
|
|
4797
|
+
if (cairoVersion === "1") {
|
|
4798
|
+
return fromCallsToExecuteCalldata_cairo1(calls);
|
|
4799
|
+
}
|
|
4800
|
+
return fromCallsToExecuteCalldata(calls);
|
|
4801
|
+
};
|
|
4785
4802
|
|
|
4786
4803
|
// src/utils/typedData/index.ts
|
|
4787
4804
|
var typedData_exports = {};
|
|
@@ -5008,7 +5025,7 @@ var Signer = class {
|
|
|
5008
5025
|
if (abis && abis.length !== transactions.length) {
|
|
5009
5026
|
throw new Error("ABI must be provided for each transaction or no transaction");
|
|
5010
5027
|
}
|
|
5011
|
-
const calldata =
|
|
5028
|
+
const calldata = getExecuteCalldata(transactions, transactionsDetail.cairoVersion);
|
|
5012
5029
|
const msgHash = calculateTransactionHash(
|
|
5013
5030
|
transactionsDetail.walletAddress,
|
|
5014
5031
|
transactionsDetail.version,
|
|
@@ -5099,7 +5116,7 @@ var Account = class extends Provider {
|
|
|
5099
5116
|
async estimateFee(calls, estimateFeeDetails) {
|
|
5100
5117
|
return this.estimateInvokeFee(calls, estimateFeeDetails);
|
|
5101
5118
|
}
|
|
5102
|
-
async estimateInvokeFee(calls, { nonce: providedNonce, blockIdentifier, skipValidate } = {}) {
|
|
5119
|
+
async estimateInvokeFee(calls, { nonce: providedNonce, blockIdentifier, skipValidate, cairoVersion } = {}) {
|
|
5103
5120
|
const transactions = Array.isArray(calls) ? calls : [calls];
|
|
5104
5121
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
5105
5122
|
const version = toBigInt(feeTransactionVersion);
|
|
@@ -5109,7 +5126,8 @@ var Account = class extends Provider {
|
|
|
5109
5126
|
nonce,
|
|
5110
5127
|
maxFee: ZERO,
|
|
5111
5128
|
version,
|
|
5112
|
-
chainId
|
|
5129
|
+
chainId,
|
|
5130
|
+
cairoVersion: cairoVersion ?? "0"
|
|
5113
5131
|
};
|
|
5114
5132
|
const invocation = await this.buildInvocation(transactions, signerDetails);
|
|
5115
5133
|
const response = await super.getInvokeEstimateFee(
|
|
@@ -5124,13 +5142,20 @@ var Account = class extends Provider {
|
|
|
5124
5142
|
suggestedMaxFee
|
|
5125
5143
|
};
|
|
5126
5144
|
}
|
|
5127
|
-
async estimateDeclareFee({ contract, classHash: providedClassHash, casm, compiledClassHash }, { blockIdentifier, nonce: providedNonce, skipValidate } = {}) {
|
|
5145
|
+
async estimateDeclareFee({ contract, classHash: providedClassHash, casm, compiledClassHash }, { blockIdentifier, nonce: providedNonce, skipValidate, cairoVersion } = {}) {
|
|
5128
5146
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
5129
5147
|
const version = !isSierra(contract) ? toBigInt(feeTransactionVersion) : transactionVersion_2;
|
|
5130
5148
|
const chainId = await this.getChainId();
|
|
5131
5149
|
const declareContractTransaction = await this.buildDeclarePayload(
|
|
5132
5150
|
{ classHash: providedClassHash, contract, casm, compiledClassHash },
|
|
5133
|
-
{
|
|
5151
|
+
{
|
|
5152
|
+
nonce,
|
|
5153
|
+
chainId,
|
|
5154
|
+
version,
|
|
5155
|
+
walletAddress: this.address,
|
|
5156
|
+
maxFee: ZERO,
|
|
5157
|
+
cairoVersion: cairoVersion ?? "0"
|
|
5158
|
+
}
|
|
5134
5159
|
);
|
|
5135
5160
|
const response = await super.getDeclareEstimateFee(
|
|
5136
5161
|
declareContractTransaction,
|
|
@@ -5149,13 +5174,20 @@ var Account = class extends Provider {
|
|
|
5149
5174
|
addressSalt = 0,
|
|
5150
5175
|
constructorCalldata = [],
|
|
5151
5176
|
contractAddress: providedContractAddress
|
|
5152
|
-
}, { blockIdentifier, skipValidate } = {}) {
|
|
5177
|
+
}, { blockIdentifier, skipValidate, cairoVersion } = {}) {
|
|
5153
5178
|
const version = toBigInt(feeTransactionVersion);
|
|
5154
5179
|
const nonce = ZERO;
|
|
5155
5180
|
const chainId = await this.getChainId();
|
|
5156
5181
|
const payload = await this.buildAccountDeployPayload(
|
|
5157
5182
|
{ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress },
|
|
5158
|
-
{
|
|
5183
|
+
{
|
|
5184
|
+
nonce,
|
|
5185
|
+
chainId,
|
|
5186
|
+
version,
|
|
5187
|
+
walletAddress: this.address,
|
|
5188
|
+
maxFee: ZERO,
|
|
5189
|
+
cairoVersion: cairoVersion ?? "0"
|
|
5190
|
+
}
|
|
5159
5191
|
);
|
|
5160
5192
|
const response = await super.getDeployAccountEstimateFee(
|
|
5161
5193
|
{ ...payload },
|
|
@@ -5173,7 +5205,7 @@ var Account = class extends Provider {
|
|
|
5173
5205
|
const calls = this.buildUDCContractPayload(payload);
|
|
5174
5206
|
return this.estimateInvokeFee(calls, transactionsDetail);
|
|
5175
5207
|
}
|
|
5176
|
-
async estimateFeeBulk(transactions, { nonce: providedNonce, blockIdentifier } = {}) {
|
|
5208
|
+
async estimateFeeBulk(transactions, { nonce: providedNonce, blockIdentifier, cairoVersion } = {}) {
|
|
5177
5209
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
5178
5210
|
const version = toBigInt(feeTransactionVersion);
|
|
5179
5211
|
const chainId = await this.getChainId();
|
|
@@ -5184,7 +5216,8 @@ var Account = class extends Provider {
|
|
|
5184
5216
|
nonce: toBigInt(Number(nonce) + index),
|
|
5185
5217
|
maxFee: ZERO,
|
|
5186
5218
|
version,
|
|
5187
|
-
chainId
|
|
5219
|
+
chainId,
|
|
5220
|
+
cairoVersion: cairoVersion ?? "0"
|
|
5188
5221
|
};
|
|
5189
5222
|
const txPayload = transaction.payload;
|
|
5190
5223
|
let res;
|
|
@@ -5242,7 +5275,7 @@ var Account = class extends Provider {
|
|
|
5242
5275
|
});
|
|
5243
5276
|
}
|
|
5244
5277
|
async buildInvocation(call, signerDetails) {
|
|
5245
|
-
const calldata =
|
|
5278
|
+
const calldata = getExecuteCalldata(call, signerDetails.cairoVersion);
|
|
5246
5279
|
const signature = await this.signer.signTransaction(call, signerDetails);
|
|
5247
5280
|
return {
|
|
5248
5281
|
contractAddress: this.address,
|
|
@@ -5259,15 +5292,17 @@ var Account = class extends Provider {
|
|
|
5259
5292
|
);
|
|
5260
5293
|
const version = toBigInt(transactionVersion);
|
|
5261
5294
|
const chainId = await this.getChainId();
|
|
5295
|
+
const cairoVersion = transactionsDetail.cairoVersion ?? "0";
|
|
5262
5296
|
const signerDetails = {
|
|
5263
5297
|
walletAddress: this.address,
|
|
5264
5298
|
nonce,
|
|
5265
5299
|
maxFee,
|
|
5266
5300
|
version,
|
|
5267
|
-
chainId
|
|
5301
|
+
chainId,
|
|
5302
|
+
cairoVersion
|
|
5268
5303
|
};
|
|
5269
5304
|
const signature = await this.signer.signTransaction(transactions, signerDetails, abis);
|
|
5270
|
-
const calldata =
|
|
5305
|
+
const calldata = getExecuteCalldata(transactions, cairoVersion);
|
|
5271
5306
|
return this.invokeFunction(
|
|
5272
5307
|
{ contractAddress: this.address, calldata, signature },
|
|
5273
5308
|
{
|
|
@@ -5292,7 +5327,8 @@ var Account = class extends Provider {
|
|
|
5292
5327
|
details.chainId = await this.getChainId();
|
|
5293
5328
|
const declareContractTransaction = await this.buildDeclarePayload(declareContractPayload, {
|
|
5294
5329
|
...details,
|
|
5295
|
-
walletAddress: this.address
|
|
5330
|
+
walletAddress: this.address,
|
|
5331
|
+
cairoVersion: transactionsDetail.cairoVersion ?? "0"
|
|
5296
5332
|
});
|
|
5297
5333
|
return this.declareContract(declareContractTransaction, details);
|
|
5298
5334
|
}
|
|
@@ -5402,7 +5438,7 @@ var Account = class extends Provider {
|
|
|
5402
5438
|
entrypoint: "isValidSignature",
|
|
5403
5439
|
calldata: compileCalldata({
|
|
5404
5440
|
hash: toBigInt(hash).toString(),
|
|
5405
|
-
signature:
|
|
5441
|
+
signature: formatSignature(signature)
|
|
5406
5442
|
})
|
|
5407
5443
|
});
|
|
5408
5444
|
return true;
|
|
@@ -5433,7 +5469,7 @@ var Account = class extends Provider {
|
|
|
5433
5469
|
feeEstimate = { suggestedMaxFee: ZERO, overall_fee: ZERO };
|
|
5434
5470
|
break;
|
|
5435
5471
|
}
|
|
5436
|
-
return feeEstimate.suggestedMaxFee
|
|
5472
|
+
return feeEstimate.suggestedMaxFee;
|
|
5437
5473
|
}
|
|
5438
5474
|
async buildDeclarePayload(payload, { nonce, chainId, version, walletAddress, maxFee }) {
|
|
5439
5475
|
const { classHash, contract, compiledClassHash } = extractContractHashes(payload);
|
|
@@ -5501,7 +5537,7 @@ var Account = class extends Provider {
|
|
|
5501
5537
|
});
|
|
5502
5538
|
return calls;
|
|
5503
5539
|
}
|
|
5504
|
-
async simulateTransaction(calls, { nonce: providedNonce, blockIdentifier, skipValidate } = {}) {
|
|
5540
|
+
async simulateTransaction(calls, { nonce: providedNonce, blockIdentifier, skipValidate, cairoVersion } = {}) {
|
|
5505
5541
|
const transactions = Array.isArray(calls) ? calls : [calls];
|
|
5506
5542
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
5507
5543
|
const version = toBigInt(feeTransactionVersion);
|
|
@@ -5511,7 +5547,8 @@ var Account = class extends Provider {
|
|
|
5511
5547
|
nonce,
|
|
5512
5548
|
maxFee: ZERO,
|
|
5513
5549
|
version,
|
|
5514
|
-
chainId
|
|
5550
|
+
chainId,
|
|
5551
|
+
cairoVersion: cairoVersion ?? "0"
|
|
5515
5552
|
};
|
|
5516
5553
|
const invocation = await this.buildInvocation(transactions, signerDetails);
|
|
5517
5554
|
const response = await super.getSimulateTransaction(
|