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.global.js
CHANGED
|
@@ -12696,7 +12696,7 @@ var starknet = (() => {
|
|
|
12696
12696
|
Literal: () => Literal,
|
|
12697
12697
|
Provider: () => RpcProvider2,
|
|
12698
12698
|
ProviderInterface: () => ProviderInterface,
|
|
12699
|
-
RPC: () =>
|
|
12699
|
+
RPC: () => api_exports2,
|
|
12700
12700
|
RPC06: () => rpc_0_6_exports,
|
|
12701
12701
|
RPC07: () => rpc_0_7_exports,
|
|
12702
12702
|
ReceiptTx: () => ReceiptTx,
|
|
@@ -12746,6 +12746,7 @@ var starknet = (() => {
|
|
|
12746
12746
|
merkle: () => merkle_exports,
|
|
12747
12747
|
num: () => num_exports,
|
|
12748
12748
|
number: () => number3,
|
|
12749
|
+
parseCalldataField: () => parseCalldataField,
|
|
12749
12750
|
parseUDCEvent: () => parseUDCEvent,
|
|
12750
12751
|
provider: () => provider_exports,
|
|
12751
12752
|
selector: () => selector_exports,
|
|
@@ -12790,8 +12791,9 @@ var starknet = (() => {
|
|
|
12790
12791
|
});
|
|
12791
12792
|
|
|
12792
12793
|
// src/types/api/index.ts
|
|
12793
|
-
var
|
|
12794
|
-
__export(
|
|
12794
|
+
var api_exports2 = {};
|
|
12795
|
+
__export(api_exports2, {
|
|
12796
|
+
API: () => api_exports,
|
|
12795
12797
|
EBlockTag: () => EBlockTag2,
|
|
12796
12798
|
EDAMode: () => EDAMode2,
|
|
12797
12799
|
EDataAvailabilityMode: () => EDataAvailabilityMode2,
|
|
@@ -12805,9 +12807,12 @@ var starknet = (() => {
|
|
|
12805
12807
|
ETransactionVersion3: () => ETransactionVersion32,
|
|
12806
12808
|
Errors: () => errors_exports2,
|
|
12807
12809
|
JRPC: () => jsonrpc_exports,
|
|
12810
|
+
Permission: () => Permission,
|
|
12808
12811
|
RPCSPEC06: () => rpcspec_0_6_exports,
|
|
12809
|
-
RPCSPEC07: () =>
|
|
12810
|
-
SPEC: () => components_exports2
|
|
12812
|
+
RPCSPEC07: () => esm_exports,
|
|
12813
|
+
SPEC: () => components_exports2,
|
|
12814
|
+
TypedDataRevision: () => TypedDataRevision,
|
|
12815
|
+
WALLET_API: () => wallet_api_exports
|
|
12811
12816
|
});
|
|
12812
12817
|
|
|
12813
12818
|
// src/types/api/jsonrpc/index.ts
|
|
@@ -12909,9 +12914,31 @@ var starknet = (() => {
|
|
|
12909
12914
|
return ETransactionVersion34;
|
|
12910
12915
|
})(ETransactionVersion3 || {});
|
|
12911
12916
|
|
|
12912
|
-
//
|
|
12913
|
-
var
|
|
12914
|
-
__export(
|
|
12917
|
+
// node_modules/starknet-types-07/dist/esm/index.js
|
|
12918
|
+
var esm_exports = {};
|
|
12919
|
+
__export(esm_exports, {
|
|
12920
|
+
API: () => api_exports,
|
|
12921
|
+
EBlockTag: () => EBlockTag2,
|
|
12922
|
+
EDAMode: () => EDAMode2,
|
|
12923
|
+
EDataAvailabilityMode: () => EDataAvailabilityMode2,
|
|
12924
|
+
ESimulationFlag: () => ESimulationFlag2,
|
|
12925
|
+
ETransactionExecutionStatus: () => ETransactionExecutionStatus2,
|
|
12926
|
+
ETransactionFinalityStatus: () => ETransactionFinalityStatus2,
|
|
12927
|
+
ETransactionStatus: () => ETransactionStatus2,
|
|
12928
|
+
ETransactionType: () => ETransactionType2,
|
|
12929
|
+
ETransactionVersion: () => ETransactionVersion4,
|
|
12930
|
+
ETransactionVersion2: () => ETransactionVersion22,
|
|
12931
|
+
ETransactionVersion3: () => ETransactionVersion32,
|
|
12932
|
+
Errors: () => errors_exports2,
|
|
12933
|
+
Permission: () => Permission,
|
|
12934
|
+
SPEC: () => components_exports2,
|
|
12935
|
+
TypedDataRevision: () => TypedDataRevision,
|
|
12936
|
+
WALLET_API: () => wallet_api_exports
|
|
12937
|
+
});
|
|
12938
|
+
|
|
12939
|
+
// node_modules/starknet-types-07/dist/esm/api/index.js
|
|
12940
|
+
var api_exports = {};
|
|
12941
|
+
__export(api_exports, {
|
|
12915
12942
|
EBlockTag: () => EBlockTag2,
|
|
12916
12943
|
EDAMode: () => EDAMode2,
|
|
12917
12944
|
EDataAvailabilityMode: () => EDataAvailabilityMode2,
|
|
@@ -12927,59 +12954,60 @@ var starknet = (() => {
|
|
|
12927
12954
|
SPEC: () => components_exports2
|
|
12928
12955
|
});
|
|
12929
12956
|
|
|
12930
|
-
//
|
|
12957
|
+
// node_modules/starknet-types-07/dist/esm/api/errors.js
|
|
12931
12958
|
var errors_exports2 = {};
|
|
12932
12959
|
|
|
12933
|
-
//
|
|
12960
|
+
// node_modules/starknet-types-07/dist/esm/api/components.js
|
|
12934
12961
|
var components_exports2 = {};
|
|
12935
12962
|
|
|
12936
|
-
//
|
|
12937
|
-
var ETransactionType2
|
|
12963
|
+
// node_modules/starknet-types-07/dist/esm/api/nonspec.js
|
|
12964
|
+
var ETransactionType2;
|
|
12965
|
+
(function(ETransactionType3) {
|
|
12938
12966
|
ETransactionType3["DECLARE"] = "DECLARE";
|
|
12939
12967
|
ETransactionType3["DEPLOY"] = "DEPLOY";
|
|
12940
12968
|
ETransactionType3["DEPLOY_ACCOUNT"] = "DEPLOY_ACCOUNT";
|
|
12941
12969
|
ETransactionType3["INVOKE"] = "INVOKE";
|
|
12942
12970
|
ETransactionType3["L1_HANDLER"] = "L1_HANDLER";
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12971
|
+
})(ETransactionType2 || (ETransactionType2 = {}));
|
|
12972
|
+
var ESimulationFlag2;
|
|
12973
|
+
(function(ESimulationFlag3) {
|
|
12946
12974
|
ESimulationFlag3["SKIP_VALIDATE"] = "SKIP_VALIDATE";
|
|
12947
12975
|
ESimulationFlag3["SKIP_FEE_CHARGE"] = "SKIP_FEE_CHARGE";
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12976
|
+
})(ESimulationFlag2 || (ESimulationFlag2 = {}));
|
|
12977
|
+
var ETransactionStatus2;
|
|
12978
|
+
(function(ETransactionStatus3) {
|
|
12951
12979
|
ETransactionStatus3["RECEIVED"] = "RECEIVED";
|
|
12952
12980
|
ETransactionStatus3["REJECTED"] = "REJECTED";
|
|
12953
12981
|
ETransactionStatus3["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2";
|
|
12954
12982
|
ETransactionStatus3["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1";
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12983
|
+
})(ETransactionStatus2 || (ETransactionStatus2 = {}));
|
|
12984
|
+
var ETransactionFinalityStatus2;
|
|
12985
|
+
(function(ETransactionFinalityStatus3) {
|
|
12958
12986
|
ETransactionFinalityStatus3["ACCEPTED_ON_L2"] = "ACCEPTED_ON_L2";
|
|
12959
12987
|
ETransactionFinalityStatus3["ACCEPTED_ON_L1"] = "ACCEPTED_ON_L1";
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12988
|
+
})(ETransactionFinalityStatus2 || (ETransactionFinalityStatus2 = {}));
|
|
12989
|
+
var ETransactionExecutionStatus2;
|
|
12990
|
+
(function(ETransactionExecutionStatus3) {
|
|
12963
12991
|
ETransactionExecutionStatus3["SUCCEEDED"] = "SUCCEEDED";
|
|
12964
12992
|
ETransactionExecutionStatus3["REVERTED"] = "REVERTED";
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12993
|
+
})(ETransactionExecutionStatus2 || (ETransactionExecutionStatus2 = {}));
|
|
12994
|
+
var EBlockTag2;
|
|
12995
|
+
(function(EBlockTag3) {
|
|
12968
12996
|
EBlockTag3["LATEST"] = "latest";
|
|
12969
12997
|
EBlockTag3["PENDING"] = "pending";
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12998
|
+
})(EBlockTag2 || (EBlockTag2 = {}));
|
|
12999
|
+
var EDataAvailabilityMode2;
|
|
13000
|
+
(function(EDataAvailabilityMode3) {
|
|
12973
13001
|
EDataAvailabilityMode3["L1"] = "L1";
|
|
12974
13002
|
EDataAvailabilityMode3["L2"] = "L2";
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
13003
|
+
})(EDataAvailabilityMode2 || (EDataAvailabilityMode2 = {}));
|
|
13004
|
+
var EDAMode2;
|
|
13005
|
+
(function(EDAMode4) {
|
|
12978
13006
|
EDAMode4[EDAMode4["L1"] = 0] = "L1";
|
|
12979
13007
|
EDAMode4[EDAMode4["L2"] = 1] = "L2";
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
13008
|
+
})(EDAMode2 || (EDAMode2 = {}));
|
|
13009
|
+
var ETransactionVersion4;
|
|
13010
|
+
(function(ETransactionVersion5) {
|
|
12983
13011
|
ETransactionVersion5["V0"] = "0x0";
|
|
12984
13012
|
ETransactionVersion5["V1"] = "0x1";
|
|
12985
13013
|
ETransactionVersion5["V2"] = "0x2";
|
|
@@ -12988,22 +13016,41 @@ var starknet = (() => {
|
|
|
12988
13016
|
ETransactionVersion5["F1"] = "0x100000000000000000000000000000001";
|
|
12989
13017
|
ETransactionVersion5["F2"] = "0x100000000000000000000000000000002";
|
|
12990
13018
|
ETransactionVersion5["F3"] = "0x100000000000000000000000000000003";
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
13019
|
+
})(ETransactionVersion4 || (ETransactionVersion4 = {}));
|
|
13020
|
+
var ETransactionVersion22;
|
|
13021
|
+
(function(ETransactionVersion24) {
|
|
12994
13022
|
ETransactionVersion24["V0"] = "0x0";
|
|
12995
13023
|
ETransactionVersion24["V1"] = "0x1";
|
|
12996
13024
|
ETransactionVersion24["V2"] = "0x2";
|
|
12997
13025
|
ETransactionVersion24["F0"] = "0x100000000000000000000000000000000";
|
|
12998
13026
|
ETransactionVersion24["F1"] = "0x100000000000000000000000000000001";
|
|
12999
13027
|
ETransactionVersion24["F2"] = "0x100000000000000000000000000000002";
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13028
|
+
})(ETransactionVersion22 || (ETransactionVersion22 = {}));
|
|
13029
|
+
var ETransactionVersion32;
|
|
13030
|
+
(function(ETransactionVersion34) {
|
|
13003
13031
|
ETransactionVersion34["V3"] = "0x3";
|
|
13004
13032
|
ETransactionVersion34["F3"] = "0x100000000000000000000000000000003";
|
|
13005
|
-
|
|
13006
|
-
|
|
13033
|
+
})(ETransactionVersion32 || (ETransactionVersion32 = {}));
|
|
13034
|
+
|
|
13035
|
+
// node_modules/starknet-types-07/dist/esm/wallet-api/index.js
|
|
13036
|
+
var wallet_api_exports = {};
|
|
13037
|
+
__export(wallet_api_exports, {
|
|
13038
|
+
Permission: () => Permission,
|
|
13039
|
+
TypedDataRevision: () => TypedDataRevision
|
|
13040
|
+
});
|
|
13041
|
+
|
|
13042
|
+
// node_modules/starknet-types-07/dist/esm/wallet-api/constants.js
|
|
13043
|
+
var Permission;
|
|
13044
|
+
(function(Permission2) {
|
|
13045
|
+
Permission2["Accounts"] = "accounts";
|
|
13046
|
+
})(Permission || (Permission = {}));
|
|
13047
|
+
|
|
13048
|
+
// node_modules/starknet-types-07/dist/esm/wallet-api/typedData.js
|
|
13049
|
+
var TypedDataRevision;
|
|
13050
|
+
(function(TypedDataRevision2) {
|
|
13051
|
+
TypedDataRevision2["Active"] = "1";
|
|
13052
|
+
TypedDataRevision2["Legacy"] = "0";
|
|
13053
|
+
})(TypedDataRevision || (TypedDataRevision = {}));
|
|
13007
13054
|
|
|
13008
13055
|
// src/utils/encode.ts
|
|
13009
13056
|
var encode_exports = {};
|
|
@@ -13352,7 +13399,7 @@ var starknet = (() => {
|
|
|
13352
13399
|
BlockTag: () => BlockTag,
|
|
13353
13400
|
EntryPointType: () => EntryPointType,
|
|
13354
13401
|
Literal: () => Literal,
|
|
13355
|
-
RPC: () =>
|
|
13402
|
+
RPC: () => api_exports2,
|
|
13356
13403
|
SIMULATION_FLAG: () => SIMULATION_FLAG,
|
|
13357
13404
|
TransactionExecutionStatus: () => TransactionExecutionStatus,
|
|
13358
13405
|
TransactionFinalityStatus: () => TransactionFinalityStatus,
|
|
@@ -13445,13 +13492,6 @@ var starknet = (() => {
|
|
|
13445
13492
|
return BlockTag2;
|
|
13446
13493
|
})(BlockTag || {});
|
|
13447
13494
|
|
|
13448
|
-
// node_modules/starknet-types/dist/esm/common/typedData.js
|
|
13449
|
-
var TypedDataRevision;
|
|
13450
|
-
(function(TypedDataRevision2) {
|
|
13451
|
-
TypedDataRevision2["Active"] = "1";
|
|
13452
|
-
TypedDataRevision2["Legacy"] = "0";
|
|
13453
|
-
})(TypedDataRevision || (TypedDataRevision = {}));
|
|
13454
|
-
|
|
13455
13495
|
// src/utils/assert.ts
|
|
13456
13496
|
function assert(condition, message) {
|
|
13457
13497
|
if (!condition) {
|
|
@@ -13812,8 +13852,8 @@ var starknet = (() => {
|
|
|
13812
13852
|
});
|
|
13813
13853
|
|
|
13814
13854
|
// node_modules/@scure/starknet/lib/esm/index.js
|
|
13815
|
-
var
|
|
13816
|
-
__export(
|
|
13855
|
+
var esm_exports2 = {};
|
|
13856
|
+
__export(esm_exports2, {
|
|
13817
13857
|
CURVE: () => CURVE,
|
|
13818
13858
|
Fp251: () => Fp251,
|
|
13819
13859
|
MAX_VALUE: () => MAX_VALUE,
|
|
@@ -18531,7 +18571,7 @@ var starknet = (() => {
|
|
|
18531
18571
|
// src/utils/ec.ts
|
|
18532
18572
|
var ec_exports = {};
|
|
18533
18573
|
__export(ec_exports, {
|
|
18534
|
-
starkCurve: () =>
|
|
18574
|
+
starkCurve: () => esm_exports2,
|
|
18535
18575
|
weierstrass: () => weierstrass_exports
|
|
18536
18576
|
});
|
|
18537
18577
|
|
|
@@ -19561,7 +19601,7 @@ var starknet = (() => {
|
|
|
19561
19601
|
|
|
19562
19602
|
// src/utils/hash/transactionHash/v2.ts
|
|
19563
19603
|
function computeHashOnElements2(data) {
|
|
19564
|
-
return [...data, data.length].reduce((x, y) =>
|
|
19604
|
+
return [...data, data.length].reduce((x, y) => esm_exports2.pedersen(toBigInt(x), toBigInt(y)), 0).toString();
|
|
19565
19605
|
}
|
|
19566
19606
|
function calculateTransactionHashCommon(txHashPrefix, version, contractAddress, entryPointSelector, calldata, maxFee, chainId, additionalData = []) {
|
|
19567
19607
|
const calldataHash = computeHashOnElements2(calldata);
|
|
@@ -19704,7 +19744,7 @@ var starknet = (() => {
|
|
|
19704
19744
|
|
|
19705
19745
|
// src/utils/hash/transactionHash/index.ts
|
|
19706
19746
|
function isV3InvokeTx(args) {
|
|
19707
|
-
return [
|
|
19747
|
+
return [ETransactionVersion4.V3, ETransactionVersion4.F3].includes(
|
|
19708
19748
|
args.version
|
|
19709
19749
|
);
|
|
19710
19750
|
}
|
|
@@ -19734,7 +19774,7 @@ var starknet = (() => {
|
|
|
19734
19774
|
);
|
|
19735
19775
|
}
|
|
19736
19776
|
function isV3DeclareTx(args) {
|
|
19737
|
-
return [
|
|
19777
|
+
return [ETransactionVersion4.V3, ETransactionVersion4.F3].includes(
|
|
19738
19778
|
args.version
|
|
19739
19779
|
);
|
|
19740
19780
|
}
|
|
@@ -19766,7 +19806,7 @@ var starknet = (() => {
|
|
|
19766
19806
|
);
|
|
19767
19807
|
}
|
|
19768
19808
|
function isV3DeployAccountTx(args) {
|
|
19769
|
-
return [
|
|
19809
|
+
return [ETransactionVersion4.V3, ETransactionVersion4.F3].includes(
|
|
19770
19810
|
args.version
|
|
19771
19811
|
);
|
|
19772
19812
|
}
|
|
@@ -20363,13 +20403,13 @@ var starknet = (() => {
|
|
|
20363
20403
|
|
|
20364
20404
|
// src/utils/hash/classHash.ts
|
|
20365
20405
|
function computePedersenHash(a, b) {
|
|
20366
|
-
return
|
|
20406
|
+
return esm_exports2.pedersen(BigInt(a), BigInt(b));
|
|
20367
20407
|
}
|
|
20368
20408
|
function computePoseidonHash(a, b) {
|
|
20369
|
-
return toHex(
|
|
20409
|
+
return toHex(esm_exports2.poseidonHash(BigInt(a), BigInt(b)));
|
|
20370
20410
|
}
|
|
20371
20411
|
function computeHashOnElements3(data) {
|
|
20372
|
-
return [...data, data.length].reduce((x, y) =>
|
|
20412
|
+
return [...data, data.length].reduce((x, y) => esm_exports2.pedersen(BigInt(x), BigInt(y)), 0).toString();
|
|
20373
20413
|
}
|
|
20374
20414
|
var computePedersenHashOnElements = computeHashOnElements3;
|
|
20375
20415
|
function computePoseidonHashOnElements(data) {
|
|
@@ -20416,7 +20456,7 @@ var starknet = (() => {
|
|
|
20416
20456
|
const { abi, program } = compiledContract;
|
|
20417
20457
|
const contractClass = { abi, program };
|
|
20418
20458
|
const serializedJson = formatSpaces(stringify2(contractClass, nullSkipReplacer));
|
|
20419
|
-
return addHexPrefix(
|
|
20459
|
+
return addHexPrefix(esm_exports2.keccak(utf8ToArray(serializedJson)).toString(16));
|
|
20420
20460
|
}
|
|
20421
20461
|
function computeLegacyContractClassHash(contract) {
|
|
20422
20462
|
const compiledContract = isString(contract) ? parse2(contract) : contract;
|
|
@@ -20493,7 +20533,7 @@ var starknet = (() => {
|
|
|
20493
20533
|
}
|
|
20494
20534
|
function hashAbi(sierra) {
|
|
20495
20535
|
const indentString = formatSpaces(stringify2(sierra.abi, null));
|
|
20496
|
-
return BigInt(addHexPrefix(
|
|
20536
|
+
return BigInt(addHexPrefix(esm_exports2.keccak(utf8ToArray(indentString)).toString(16)));
|
|
20497
20537
|
}
|
|
20498
20538
|
function computeSierraContractClassHash(sierra) {
|
|
20499
20539
|
const CONTRACT_CLASS_VERSION = "CONTRACT_CLASS_V0.1.0";
|
|
@@ -24763,10 +24803,10 @@ var starknet = (() => {
|
|
|
24763
24803
|
};
|
|
24764
24804
|
}
|
|
24765
24805
|
function intDAM(dam) {
|
|
24766
|
-
if (dam ===
|
|
24767
|
-
return
|
|
24768
|
-
if (dam ===
|
|
24769
|
-
return
|
|
24806
|
+
if (dam === EDataAvailabilityMode2.L1)
|
|
24807
|
+
return EDAMode2.L1;
|
|
24808
|
+
if (dam === EDataAvailabilityMode2.L2)
|
|
24809
|
+
return EDAMode2.L2;
|
|
24770
24810
|
throw Error("EDAM conversion");
|
|
24771
24811
|
}
|
|
24772
24812
|
function toTransactionVersion(defaultVersion, providedVersion) {
|
|
@@ -24784,14 +24824,14 @@ var starknet = (() => {
|
|
|
24784
24824
|
if (!providedVersion)
|
|
24785
24825
|
return void 0;
|
|
24786
24826
|
const version = toHex(providedVersion);
|
|
24787
|
-
if (version ===
|
|
24788
|
-
return
|
|
24789
|
-
if (version ===
|
|
24790
|
-
return
|
|
24791
|
-
if (version ===
|
|
24792
|
-
return
|
|
24793
|
-
if (version ===
|
|
24794
|
-
return
|
|
24827
|
+
if (version === ETransactionVersion4.V0)
|
|
24828
|
+
return ETransactionVersion4.F0;
|
|
24829
|
+
if (version === ETransactionVersion4.V1)
|
|
24830
|
+
return ETransactionVersion4.F1;
|
|
24831
|
+
if (version === ETransactionVersion4.V2)
|
|
24832
|
+
return ETransactionVersion4.F2;
|
|
24833
|
+
if (version === ETransactionVersion4.V3)
|
|
24834
|
+
return ETransactionVersion4.F3;
|
|
24795
24835
|
throw Error(`toFeeVersion: ${version} is not supported`);
|
|
24796
24836
|
}
|
|
24797
24837
|
function v3Details(details) {
|
|
@@ -24799,16 +24839,16 @@ var starknet = (() => {
|
|
|
24799
24839
|
tip: details.tip || 0,
|
|
24800
24840
|
paymasterData: details.paymasterData || [],
|
|
24801
24841
|
accountDeploymentData: details.accountDeploymentData || [],
|
|
24802
|
-
nonceDataAvailabilityMode: details.nonceDataAvailabilityMode ||
|
|
24803
|
-
feeDataAvailabilityMode: details.feeDataAvailabilityMode ||
|
|
24842
|
+
nonceDataAvailabilityMode: details.nonceDataAvailabilityMode || EDataAvailabilityMode2.L1,
|
|
24843
|
+
feeDataAvailabilityMode: details.feeDataAvailabilityMode || EDataAvailabilityMode2.L1,
|
|
24804
24844
|
resourceBounds: details.resourceBounds ?? estimateFeeToBounds(ZERO)
|
|
24805
24845
|
};
|
|
24806
24846
|
}
|
|
24807
24847
|
function reduceV2(providedVersion) {
|
|
24808
|
-
if (providedVersion ===
|
|
24809
|
-
return
|
|
24810
|
-
if (providedVersion ===
|
|
24811
|
-
return
|
|
24848
|
+
if (providedVersion === ETransactionVersion4.F2)
|
|
24849
|
+
return ETransactionVersion4.F1;
|
|
24850
|
+
if (providedVersion === ETransactionVersion4.V2)
|
|
24851
|
+
return ETransactionVersion4.V1;
|
|
24812
24852
|
return providedVersion;
|
|
24813
24853
|
}
|
|
24814
24854
|
|
|
@@ -25565,9 +25605,10 @@ var starknet = (() => {
|
|
|
25565
25605
|
return createSierraContractClass(parsedContract);
|
|
25566
25606
|
}
|
|
25567
25607
|
var getDefaultNodeUrl = (networkName, mute = false) => {
|
|
25568
|
-
if (!mute)
|
|
25608
|
+
if (!mute) {
|
|
25569
25609
|
console.warn("Using default public node url, please provide nodeUrl in provider options!");
|
|
25570
|
-
|
|
25610
|
+
}
|
|
25611
|
+
const nodes = RPC_NODES[networkName ?? "SN_SEPOLIA" /* SN_SEPOLIA */];
|
|
25571
25612
|
const randIdx = Math.floor(Math.random() * nodes.length);
|
|
25572
25613
|
return nodes[randIdx];
|
|
25573
25614
|
};
|
|
@@ -25590,10 +25631,14 @@ var starknet = (() => {
|
|
|
25590
25631
|
tag = null;
|
|
25591
25632
|
setIdentifier(__identifier) {
|
|
25592
25633
|
if (isString(__identifier)) {
|
|
25593
|
-
if (
|
|
25634
|
+
if (isDecimalString(__identifier)) {
|
|
25635
|
+
this.number = parseInt(__identifier, 10);
|
|
25636
|
+
} else if (isHex(__identifier)) {
|
|
25594
25637
|
this.hash = __identifier;
|
|
25595
25638
|
} else if (validBlockTags.includes(__identifier)) {
|
|
25596
25639
|
this.tag = __identifier;
|
|
25640
|
+
} else {
|
|
25641
|
+
throw TypeError(`Block identifier unmanaged: ${__identifier}`);
|
|
25597
25642
|
}
|
|
25598
25643
|
} else if (isBigInt(__identifier)) {
|
|
25599
25644
|
this.hash = toHex(__identifier);
|
|
@@ -25602,6 +25647,9 @@ var starknet = (() => {
|
|
|
25602
25647
|
} else {
|
|
25603
25648
|
this.tag = "pending" /* pending */;
|
|
25604
25649
|
}
|
|
25650
|
+
if (isNumber(this.number) && this.number < 0) {
|
|
25651
|
+
throw TypeError(`Block number (${this.number}) can't be negative`);
|
|
25652
|
+
}
|
|
25605
25653
|
}
|
|
25606
25654
|
constructor(_identifier) {
|
|
25607
25655
|
this.setIdentifier(_identifier);
|
|
@@ -25631,15 +25679,10 @@ var starknet = (() => {
|
|
|
25631
25679
|
}
|
|
25632
25680
|
valueOf = () => this.number;
|
|
25633
25681
|
toString = () => this.hash;
|
|
25634
|
-
/* get sequencerIdentifier(): SequencerIdentifier {
|
|
25635
|
-
return this.hash !== null
|
|
25636
|
-
? { blockHash: this.hash as string }
|
|
25637
|
-
: { blockNumber: (this.number ?? this.tag) as BlockNumber };
|
|
25638
|
-
} */
|
|
25639
25682
|
};
|
|
25640
25683
|
function isV3Tx(details) {
|
|
25641
|
-
const version = details.version ? toHex(details.version) :
|
|
25642
|
-
return version ===
|
|
25684
|
+
const version = details.version ? toHex(details.version) : ETransactionVersion4.V3;
|
|
25685
|
+
return version === ETransactionVersion4.V3 || version === ETransactionVersion4.F3;
|
|
25643
25686
|
}
|
|
25644
25687
|
function isVersion(version, response) {
|
|
25645
25688
|
const [majorS, minorS] = version.split(".");
|
|
@@ -25740,7 +25783,7 @@ var starknet = (() => {
|
|
|
25740
25783
|
]
|
|
25741
25784
|
},
|
|
25742
25785
|
address: calculateContractAddressFromHash(
|
|
25743
|
-
unique2 ?
|
|
25786
|
+
unique2 ? esm_exports2.pedersen(address, deploySalt) : deploySalt,
|
|
25744
25787
|
classHash,
|
|
25745
25788
|
compiledConstructorCallData,
|
|
25746
25789
|
unique2 ? UDC.ADDRESS : 0
|
|
@@ -25754,10 +25797,10 @@ var starknet = (() => {
|
|
|
25754
25797
|
}
|
|
25755
25798
|
function getVersionsByType(versionType) {
|
|
25756
25799
|
return versionType === "fee" ? {
|
|
25757
|
-
v1:
|
|
25758
|
-
v2:
|
|
25759
|
-
v3:
|
|
25760
|
-
} : { v1:
|
|
25800
|
+
v1: ETransactionVersion4.F1,
|
|
25801
|
+
v2: ETransactionVersion4.F2,
|
|
25802
|
+
v3: ETransactionVersion4.F3
|
|
25803
|
+
} : { v1: ETransactionVersion4.V1, v2: ETransactionVersion4.V2, v3: ETransactionVersion4.V3 };
|
|
25761
25804
|
}
|
|
25762
25805
|
|
|
25763
25806
|
// src/channel/rpc_0_6.ts
|
|
@@ -26245,7 +26288,6 @@ var starknet = (() => {
|
|
|
26245
26288
|
return {
|
|
26246
26289
|
// v0 v1 v3
|
|
26247
26290
|
type: rpcspec_0_6_exports.ETransactionType.INVOKE,
|
|
26248
|
-
// TODO: Diff between sequencer and rpc invoke type
|
|
26249
26291
|
sender_address: invocation.contractAddress,
|
|
26250
26292
|
calldata: CallData.toHex(invocation.calldata),
|
|
26251
26293
|
version: toHex(invocation.version || defaultVersions.v3),
|
|
@@ -26464,9 +26506,9 @@ var starknet = (() => {
|
|
|
26464
26506
|
const block_id = new Block(blockIdentifier).identifier;
|
|
26465
26507
|
const simulationFlags = [];
|
|
26466
26508
|
if (skipValidate)
|
|
26467
|
-
simulationFlags.push(
|
|
26509
|
+
simulationFlags.push(esm_exports.ESimulationFlag.SKIP_VALIDATE);
|
|
26468
26510
|
if (skipFeeCharge)
|
|
26469
|
-
simulationFlags.push(
|
|
26511
|
+
simulationFlags.push(esm_exports.ESimulationFlag.SKIP_FEE_CHARGE);
|
|
26470
26512
|
return this.fetchEndpoint("starknet_simulateTransactions", {
|
|
26471
26513
|
block_id,
|
|
26472
26514
|
transactions: invocations.map((it) => this.buildTransaction(it)),
|
|
@@ -26480,15 +26522,15 @@ var starknet = (() => {
|
|
|
26480
26522
|
let isErrorState = false;
|
|
26481
26523
|
const retryInterval = options?.retryInterval ?? 5e3;
|
|
26482
26524
|
const errorStates = options?.errorStates ?? [
|
|
26483
|
-
|
|
26525
|
+
esm_exports.ETransactionStatus.REJECTED
|
|
26484
26526
|
// TODO: commented out to preserve the long-standing behavior of "reverted" not being treated as an error by default
|
|
26485
26527
|
// should decide which behavior to keep in the future
|
|
26486
26528
|
// RPC.ETransactionExecutionStatus.REVERTED,
|
|
26487
26529
|
];
|
|
26488
26530
|
const successStates = options?.successStates ?? [
|
|
26489
|
-
|
|
26490
|
-
|
|
26491
|
-
|
|
26531
|
+
esm_exports.ETransactionExecutionStatus.SUCCEEDED,
|
|
26532
|
+
esm_exports.ETransactionStatus.ACCEPTED_ON_L2,
|
|
26533
|
+
esm_exports.ETransactionStatus.ACCEPTED_ON_L1
|
|
26492
26534
|
];
|
|
26493
26535
|
let txStatus;
|
|
26494
26536
|
while (!onchain) {
|
|
@@ -26573,7 +26615,7 @@ var starknet = (() => {
|
|
|
26573
26615
|
let flags = {};
|
|
26574
26616
|
if (!isVersion("0.5", await this.getSpecVersion())) {
|
|
26575
26617
|
flags = {
|
|
26576
|
-
simulation_flags: skipValidate ? [
|
|
26618
|
+
simulation_flags: skipValidate ? [esm_exports.ESimulationFlag.SKIP_VALIDATE] : []
|
|
26577
26619
|
};
|
|
26578
26620
|
}
|
|
26579
26621
|
return this.fetchEndpoint("starknet_estimateFee", {
|
|
@@ -26589,9 +26631,9 @@ var starknet = (() => {
|
|
|
26589
26631
|
invoke_transaction: {
|
|
26590
26632
|
sender_address: functionInvocation.contractAddress,
|
|
26591
26633
|
calldata: CallData.toHex(functionInvocation.calldata),
|
|
26592
|
-
type:
|
|
26634
|
+
type: esm_exports.ETransactionType.INVOKE,
|
|
26593
26635
|
max_fee: toHex(details.maxFee || 0),
|
|
26594
|
-
version:
|
|
26636
|
+
version: esm_exports.ETransactionVersion.V1,
|
|
26595
26637
|
signature: signatureToHexArray(functionInvocation.signature),
|
|
26596
26638
|
nonce: toHex(details.nonce)
|
|
26597
26639
|
}
|
|
@@ -26599,10 +26641,10 @@ var starknet = (() => {
|
|
|
26599
26641
|
} else {
|
|
26600
26642
|
promise = this.fetchEndpoint("starknet_addInvokeTransaction", {
|
|
26601
26643
|
invoke_transaction: {
|
|
26602
|
-
type:
|
|
26644
|
+
type: esm_exports.ETransactionType.INVOKE,
|
|
26603
26645
|
sender_address: functionInvocation.contractAddress,
|
|
26604
26646
|
calldata: CallData.toHex(functionInvocation.calldata),
|
|
26605
|
-
version:
|
|
26647
|
+
version: esm_exports.ETransactionVersion.V3,
|
|
26606
26648
|
signature: signatureToHexArray(functionInvocation.signature),
|
|
26607
26649
|
nonce: toHex(details.nonce),
|
|
26608
26650
|
resource_bounds: details.resourceBounds,
|
|
@@ -26621,13 +26663,13 @@ var starknet = (() => {
|
|
|
26621
26663
|
if (!isSierra(contract) && !isV3Tx(details)) {
|
|
26622
26664
|
promise = this.fetchEndpoint("starknet_addDeclareTransaction", {
|
|
26623
26665
|
declare_transaction: {
|
|
26624
|
-
type:
|
|
26666
|
+
type: esm_exports.ETransactionType.DECLARE,
|
|
26625
26667
|
contract_class: {
|
|
26626
26668
|
program: contract.program,
|
|
26627
26669
|
entry_points_by_type: contract.entry_points_by_type,
|
|
26628
26670
|
abi: contract.abi
|
|
26629
26671
|
},
|
|
26630
|
-
version:
|
|
26672
|
+
version: esm_exports.ETransactionVersion.V1,
|
|
26631
26673
|
max_fee: toHex(details.maxFee || 0),
|
|
26632
26674
|
signature: signatureToHexArray(signature),
|
|
26633
26675
|
sender_address: senderAddress,
|
|
@@ -26637,7 +26679,7 @@ var starknet = (() => {
|
|
|
26637
26679
|
} else if (isSierra(contract) && !isV3Tx(details)) {
|
|
26638
26680
|
promise = this.fetchEndpoint("starknet_addDeclareTransaction", {
|
|
26639
26681
|
declare_transaction: {
|
|
26640
|
-
type:
|
|
26682
|
+
type: esm_exports.ETransactionType.DECLARE,
|
|
26641
26683
|
contract_class: {
|
|
26642
26684
|
sierra_program: decompressProgram(contract.sierra_program),
|
|
26643
26685
|
contract_class_version: contract.contract_class_version,
|
|
@@ -26645,7 +26687,7 @@ var starknet = (() => {
|
|
|
26645
26687
|
abi: contract.abi
|
|
26646
26688
|
},
|
|
26647
26689
|
compiled_class_hash: compiledClassHash || "",
|
|
26648
|
-
version:
|
|
26690
|
+
version: esm_exports.ETransactionVersion.V2,
|
|
26649
26691
|
max_fee: toHex(details.maxFee || 0),
|
|
26650
26692
|
signature: signatureToHexArray(signature),
|
|
26651
26693
|
sender_address: senderAddress,
|
|
@@ -26655,10 +26697,10 @@ var starknet = (() => {
|
|
|
26655
26697
|
} else if (isSierra(contract) && isV3Tx(details)) {
|
|
26656
26698
|
promise = this.fetchEndpoint("starknet_addDeclareTransaction", {
|
|
26657
26699
|
declare_transaction: {
|
|
26658
|
-
type:
|
|
26700
|
+
type: esm_exports.ETransactionType.DECLARE,
|
|
26659
26701
|
sender_address: senderAddress,
|
|
26660
26702
|
compiled_class_hash: compiledClassHash || "",
|
|
26661
|
-
version:
|
|
26703
|
+
version: esm_exports.ETransactionVersion.V3,
|
|
26662
26704
|
signature: signatureToHexArray(signature),
|
|
26663
26705
|
nonce: toHex(details.nonce),
|
|
26664
26706
|
contract_class: {
|
|
@@ -26688,9 +26730,9 @@ var starknet = (() => {
|
|
|
26688
26730
|
constructor_calldata: CallData.toHex(constructorCalldata || []),
|
|
26689
26731
|
class_hash: toHex(classHash),
|
|
26690
26732
|
contract_address_salt: toHex(addressSalt || 0),
|
|
26691
|
-
type:
|
|
26733
|
+
type: esm_exports.ETransactionType.DEPLOY_ACCOUNT,
|
|
26692
26734
|
max_fee: toHex(details.maxFee || 0),
|
|
26693
|
-
version:
|
|
26735
|
+
version: esm_exports.ETransactionVersion.V1,
|
|
26694
26736
|
signature: signatureToHexArray(signature),
|
|
26695
26737
|
nonce: toHex(details.nonce)
|
|
26696
26738
|
}
|
|
@@ -26698,8 +26740,8 @@ var starknet = (() => {
|
|
|
26698
26740
|
} else {
|
|
26699
26741
|
promise = this.fetchEndpoint("starknet_addDeployAccountTransaction", {
|
|
26700
26742
|
deploy_account_transaction: {
|
|
26701
|
-
type:
|
|
26702
|
-
version:
|
|
26743
|
+
type: esm_exports.ETransactionType.DEPLOY_ACCOUNT,
|
|
26744
|
+
version: esm_exports.ETransactionVersion.V3,
|
|
26703
26745
|
signature: signatureToHexArray(signature),
|
|
26704
26746
|
nonce: toHex(details.nonce),
|
|
26705
26747
|
contract_address_salt: toHex(addressSalt || 0),
|
|
@@ -26782,8 +26824,7 @@ var starknet = (() => {
|
|
|
26782
26824
|
if (invocation.type === "INVOKE_FUNCTION" /* INVOKE */) {
|
|
26783
26825
|
return {
|
|
26784
26826
|
// v0 v1 v3
|
|
26785
|
-
type:
|
|
26786
|
-
// TODO: Diff between sequencer and rpc invoke type
|
|
26827
|
+
type: esm_exports.ETransactionType.INVOKE,
|
|
26787
26828
|
sender_address: invocation.contractAddress,
|
|
26788
26829
|
calldata: CallData.toHex(invocation.calldata),
|
|
26789
26830
|
version: toHex(invocation.version || defaultVersions.v3),
|
|
@@ -26899,6 +26940,9 @@ var starknet = (() => {
|
|
|
26899
26940
|
abi: isString(res.abi) ? JSON.parse(res.abi) : res.abi
|
|
26900
26941
|
};
|
|
26901
26942
|
}
|
|
26943
|
+
parseL1GasPriceResponse(res) {
|
|
26944
|
+
return res.l1_gas_price.price_in_wei;
|
|
26945
|
+
}
|
|
26902
26946
|
};
|
|
26903
26947
|
|
|
26904
26948
|
// src/utils/transactionReceipt.ts
|
|
@@ -26997,6 +27041,9 @@ var starknet = (() => {
|
|
|
26997
27041
|
async getBlockWithTxs(blockIdentifier) {
|
|
26998
27042
|
return this.channel.getBlockWithTxs(blockIdentifier);
|
|
26999
27043
|
}
|
|
27044
|
+
async getL1GasPrice(blockIdentifier) {
|
|
27045
|
+
return this.channel.getBlockWithTxHashes(blockIdentifier).then(this.responseParser.parseL1GasPriceResponse);
|
|
27046
|
+
}
|
|
27000
27047
|
async getBlockWithReceipts(blockIdentifier) {
|
|
27001
27048
|
if (this.channel instanceof rpc_0_6_exports.RpcChannel)
|
|
27002
27049
|
throw new LibraryError("Unsupported method for RPC version");
|
|
@@ -28236,11 +28283,11 @@ var starknet = (() => {
|
|
|
28236
28283
|
// src/signer/default.ts
|
|
28237
28284
|
var Signer = class {
|
|
28238
28285
|
pk;
|
|
28239
|
-
constructor(pk =
|
|
28286
|
+
constructor(pk = esm_exports2.utils.randomPrivateKey()) {
|
|
28240
28287
|
this.pk = pk instanceof Uint8Array ? buf2hex(pk) : toHex(pk);
|
|
28241
28288
|
}
|
|
28242
28289
|
async getPubKey() {
|
|
28243
|
-
return
|
|
28290
|
+
return esm_exports2.getStarkKey(this.pk);
|
|
28244
28291
|
}
|
|
28245
28292
|
async signMessage(typedData, accountAddress) {
|
|
28246
28293
|
const msgHash = getMessageHash(typedData, accountAddress);
|
|
@@ -28320,7 +28367,7 @@ var starknet = (() => {
|
|
|
28320
28367
|
return this.signRaw(msgHash);
|
|
28321
28368
|
}
|
|
28322
28369
|
async signRaw(msgHash) {
|
|
28323
|
-
return
|
|
28370
|
+
return esm_exports2.sign(msgHash, this.pk);
|
|
28324
28371
|
}
|
|
28325
28372
|
};
|
|
28326
28373
|
|
|
@@ -28499,7 +28546,7 @@ var starknet = (() => {
|
|
|
28499
28546
|
address;
|
|
28500
28547
|
cairoVersion;
|
|
28501
28548
|
transactionVersion;
|
|
28502
|
-
constructor(providerOrOptions, address, pkOrSigner, cairoVersion, transactionVersion =
|
|
28549
|
+
constructor(providerOrOptions, address, pkOrSigner, cairoVersion, transactionVersion = ETransactionVersion4.V2) {
|
|
28503
28550
|
super(providerOrOptions);
|
|
28504
28551
|
this.address = address.toLowerCase();
|
|
28505
28552
|
this.signer = isString(pkOrSigner) || pkOrSigner instanceof Uint8Array ? new Signer(pkOrSigner) : pkOrSigner;
|
|
@@ -28510,11 +28557,11 @@ var starknet = (() => {
|
|
|
28510
28557
|
}
|
|
28511
28558
|
// provided version or contract based preferred transactionVersion
|
|
28512
28559
|
getPreferredVersion(type12, type3) {
|
|
28513
|
-
if (this.transactionVersion ===
|
|
28560
|
+
if (this.transactionVersion === ETransactionVersion4.V3)
|
|
28514
28561
|
return type3;
|
|
28515
|
-
if (this.transactionVersion ===
|
|
28562
|
+
if (this.transactionVersion === ETransactionVersion4.V2)
|
|
28516
28563
|
return type12;
|
|
28517
|
-
return
|
|
28564
|
+
return ETransactionVersion4.V3;
|
|
28518
28565
|
}
|
|
28519
28566
|
async getNonce(blockIdentifier) {
|
|
28520
28567
|
return super.getNonceForAddress(this.address, blockIdentifier);
|
|
@@ -28550,7 +28597,7 @@ var starknet = (() => {
|
|
|
28550
28597
|
const transactions = Array.isArray(calls) ? calls : [calls];
|
|
28551
28598
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
28552
28599
|
const version = toTransactionVersion(
|
|
28553
|
-
this.getPreferredVersion(
|
|
28600
|
+
this.getPreferredVersion(ETransactionVersion4.F1, ETransactionVersion4.F3),
|
|
28554
28601
|
toFeeVersion(providedVersion)
|
|
28555
28602
|
);
|
|
28556
28603
|
const chainId = await this.getChainId();
|
|
@@ -28581,7 +28628,7 @@ var starknet = (() => {
|
|
|
28581
28628
|
} = details;
|
|
28582
28629
|
const nonce = toBigInt(providedNonce ?? await this.getNonce());
|
|
28583
28630
|
const version = toTransactionVersion(
|
|
28584
|
-
!isSierra(payload.contract) ?
|
|
28631
|
+
!isSierra(payload.contract) ? ETransactionVersion4.F1 : this.getPreferredVersion(ETransactionVersion4.F2, ETransactionVersion4.F3),
|
|
28585
28632
|
toFeeVersion(providedVersion)
|
|
28586
28633
|
);
|
|
28587
28634
|
const chainId = await this.getChainId();
|
|
@@ -28611,7 +28658,7 @@ var starknet = (() => {
|
|
|
28611
28658
|
}, details = {}) {
|
|
28612
28659
|
const { blockIdentifier, version: providedVersion, skipValidate = true } = details;
|
|
28613
28660
|
const version = toTransactionVersion(
|
|
28614
|
-
this.getPreferredVersion(
|
|
28661
|
+
this.getPreferredVersion(ETransactionVersion4.F1, ETransactionVersion4.F3),
|
|
28615
28662
|
toFeeVersion(providedVersion)
|
|
28616
28663
|
);
|
|
28617
28664
|
const nonce = ZERO;
|
|
@@ -28647,10 +28694,10 @@ var starknet = (() => {
|
|
|
28647
28694
|
const accountInvocations = await this.accountInvocationsFactory(invocations, {
|
|
28648
28695
|
...v3Details(details),
|
|
28649
28696
|
versions: [
|
|
28650
|
-
|
|
28697
|
+
ETransactionVersion4.F1,
|
|
28651
28698
|
// non-sierra
|
|
28652
28699
|
toTransactionVersion(
|
|
28653
|
-
this.getPreferredVersion(
|
|
28700
|
+
this.getPreferredVersion(ETransactionVersion4.F2, ETransactionVersion4.F3),
|
|
28654
28701
|
version
|
|
28655
28702
|
)
|
|
28656
28703
|
// sierra
|
|
@@ -28669,10 +28716,10 @@ var starknet = (() => {
|
|
|
28669
28716
|
const accountInvocations = await this.accountInvocationsFactory(invocations, {
|
|
28670
28717
|
...v3Details(details),
|
|
28671
28718
|
versions: [
|
|
28672
|
-
|
|
28719
|
+
ETransactionVersion4.V1,
|
|
28673
28720
|
// non-sierra
|
|
28674
28721
|
toTransactionVersion(
|
|
28675
|
-
this.getPreferredVersion(
|
|
28722
|
+
this.getPreferredVersion(ETransactionVersion4.V2, ETransactionVersion4.V3),
|
|
28676
28723
|
version
|
|
28677
28724
|
)
|
|
28678
28725
|
],
|
|
@@ -28691,7 +28738,7 @@ var starknet = (() => {
|
|
|
28691
28738
|
const calls = Array.isArray(transactions) ? transactions : [transactions];
|
|
28692
28739
|
const nonce = toBigInt(details.nonce ?? await this.getNonce());
|
|
28693
28740
|
const version = toTransactionVersion(
|
|
28694
|
-
this.getPreferredVersion(
|
|
28741
|
+
this.getPreferredVersion(ETransactionVersion4.V1, ETransactionVersion4.V3),
|
|
28695
28742
|
// TODO: does this depend on cairo version ?
|
|
28696
28743
|
details.version
|
|
28697
28744
|
);
|
|
@@ -28749,7 +28796,7 @@ var starknet = (() => {
|
|
|
28749
28796
|
const declareContractPayload = extractContractHashes(payload);
|
|
28750
28797
|
const { nonce, version: providedVersion } = details;
|
|
28751
28798
|
const version = toTransactionVersion(
|
|
28752
|
-
!isSierra(payload.contract) ?
|
|
28799
|
+
!isSierra(payload.contract) ? ETransactionVersion4.V1 : this.getPreferredVersion(ETransactionVersion4.V2, ETransactionVersion4.V3),
|
|
28753
28800
|
providedVersion
|
|
28754
28801
|
);
|
|
28755
28802
|
const estimate = await this.getUniversalSuggestedFee(
|
|
@@ -28813,7 +28860,7 @@ var starknet = (() => {
|
|
|
28813
28860
|
contractAddress: providedContractAddress
|
|
28814
28861
|
}, details = {}) {
|
|
28815
28862
|
const version = toTransactionVersion(
|
|
28816
|
-
this.getPreferredVersion(
|
|
28863
|
+
this.getPreferredVersion(ETransactionVersion4.V1, ETransactionVersion4.V3),
|
|
28817
28864
|
details.version
|
|
28818
28865
|
);
|
|
28819
28866
|
const nonce = ZERO;
|
|
@@ -28895,7 +28942,7 @@ var starknet = (() => {
|
|
|
28895
28942
|
async getUniversalSuggestedFee(version, { type, payload }, details) {
|
|
28896
28943
|
let maxFee = 0;
|
|
28897
28944
|
let resourceBounds = estimateFeeToBounds(ZERO);
|
|
28898
|
-
if (version ===
|
|
28945
|
+
if (version === ETransactionVersion4.V3) {
|
|
28899
28946
|
resourceBounds = details.resourceBounds ?? (await this.getSuggestedFee({ type, payload }, details)).resourceBounds;
|
|
28900
28947
|
} else {
|
|
28901
28948
|
maxFee = details.maxFee ?? (await this.getSuggestedFee({ type, payload }, details)).suggestedMaxFee;
|
|
@@ -28948,7 +28995,7 @@ var starknet = (() => {
|
|
|
28948
28995
|
async buildDeclarePayload(payload, details) {
|
|
28949
28996
|
const { classHash, contract, compiledClassHash } = extractContractHashes(payload);
|
|
28950
28997
|
const compressedCompiledContract = parseContract(contract);
|
|
28951
|
-
if (typeof compiledClassHash === "undefined" && (details.version ===
|
|
28998
|
+
if (typeof compiledClassHash === "undefined" && (details.version === ETransactionVersion32.F3 || details.version === ETransactionVersion32.V3)) {
|
|
28952
28999
|
throw Error("V3 Transaction work with Cairo1 Contracts and require compiledClassHash");
|
|
28953
29000
|
}
|
|
28954
29001
|
const signature = !details.skipValidate ? await this.signer.signDeclareTransaction({
|
|
@@ -29101,7 +29148,6 @@ var starknet = (() => {
|
|
|
29101
29148
|
var connect_exports = {};
|
|
29102
29149
|
__export(connect_exports, {
|
|
29103
29150
|
addDeclareTransaction: () => addDeclareTransaction,
|
|
29104
|
-
addDeployAccountTransaction: () => addDeployAccountTransaction,
|
|
29105
29151
|
addInvokeTransaction: () => addInvokeTransaction,
|
|
29106
29152
|
addStarknetChain: () => addStarknetChain,
|
|
29107
29153
|
deploymentData: () => deploymentData,
|
|
@@ -29115,11 +29161,11 @@ var starknet = (() => {
|
|
|
29115
29161
|
switchStarknetChain: () => switchStarknetChain,
|
|
29116
29162
|
watchAsset: () => watchAsset
|
|
29117
29163
|
});
|
|
29118
|
-
function requestAccounts(swo,
|
|
29164
|
+
function requestAccounts(swo, silent_mode = false) {
|
|
29119
29165
|
return swo.request({
|
|
29120
29166
|
type: "wallet_requestAccounts",
|
|
29121
29167
|
params: {
|
|
29122
|
-
|
|
29168
|
+
silent_mode
|
|
29123
29169
|
}
|
|
29124
29170
|
});
|
|
29125
29171
|
}
|
|
@@ -29154,30 +29200,24 @@ var starknet = (() => {
|
|
|
29154
29200
|
}
|
|
29155
29201
|
function addInvokeTransaction(swo, params) {
|
|
29156
29202
|
return swo.request({
|
|
29157
|
-
type: "
|
|
29203
|
+
type: "wallet_addInvokeTransaction",
|
|
29158
29204
|
params
|
|
29159
29205
|
});
|
|
29160
29206
|
}
|
|
29161
29207
|
function addDeclareTransaction(swo, params) {
|
|
29162
29208
|
return swo.request({
|
|
29163
|
-
type: "
|
|
29164
|
-
params
|
|
29165
|
-
});
|
|
29166
|
-
}
|
|
29167
|
-
function addDeployAccountTransaction(swo, params) {
|
|
29168
|
-
return swo.request({
|
|
29169
|
-
type: "starknet_addDeployAccountTransaction",
|
|
29209
|
+
type: "wallet_addDeclareTransaction",
|
|
29170
29210
|
params
|
|
29171
29211
|
});
|
|
29172
29212
|
}
|
|
29173
29213
|
function signMessage(swo, typedData) {
|
|
29174
29214
|
return swo.request({
|
|
29175
|
-
type: "
|
|
29215
|
+
type: "wallet_signTypedData",
|
|
29176
29216
|
params: typedData
|
|
29177
29217
|
});
|
|
29178
29218
|
}
|
|
29179
29219
|
function supportedSpecs(swo) {
|
|
29180
|
-
return swo.request({ type: "
|
|
29220
|
+
return swo.request({ type: "wallet_supportedSpecs" });
|
|
29181
29221
|
}
|
|
29182
29222
|
function onAccountChange(swo, callback) {
|
|
29183
29223
|
swo.on("accountsChanged", callback);
|
|
@@ -29206,7 +29246,7 @@ var starknet = (() => {
|
|
|
29206
29246
|
walletProvider.request({
|
|
29207
29247
|
type: "wallet_requestAccounts",
|
|
29208
29248
|
params: {
|
|
29209
|
-
|
|
29249
|
+
silent_mode: false
|
|
29210
29250
|
}
|
|
29211
29251
|
}).then((res) => {
|
|
29212
29252
|
this.address = res[0].toLowerCase();
|
|
@@ -29247,7 +29287,7 @@ var starknet = (() => {
|
|
|
29247
29287
|
const { contractAddress, entrypoint, calldata } = it;
|
|
29248
29288
|
return {
|
|
29249
29289
|
contract_address: contractAddress,
|
|
29250
|
-
entrypoint,
|
|
29290
|
+
entry_point: entrypoint,
|
|
29251
29291
|
calldata
|
|
29252
29292
|
};
|
|
29253
29293
|
});
|
|
@@ -29280,14 +29320,6 @@ var starknet = (() => {
|
|
|
29280
29320
|
contract_address: addresses
|
|
29281
29321
|
};
|
|
29282
29322
|
}
|
|
29283
|
-
deployAccount(payload) {
|
|
29284
|
-
const params = {
|
|
29285
|
-
contract_address_salt: payload.addressSalt?.toString() || "0",
|
|
29286
|
-
constructor_calldata: payload.constructorCalldata ? CallData.compile(payload.constructorCalldata) : [],
|
|
29287
|
-
class_hash: payload.classHash
|
|
29288
|
-
};
|
|
29289
|
-
return addDeployAccountTransaction(this.walletProvider, params);
|
|
29290
|
-
}
|
|
29291
29323
|
signMessage(typedData) {
|
|
29292
29324
|
return signMessage(this.walletProvider, typedData);
|
|
29293
29325
|
}
|
|
@@ -29307,7 +29339,7 @@ var starknet = (() => {
|
|
|
29307
29339
|
abiEntryMod.name = entryName;
|
|
29308
29340
|
return {
|
|
29309
29341
|
...acc,
|
|
29310
|
-
[addHexPrefix(
|
|
29342
|
+
[addHexPrefix(esm_exports2.keccak(utf8ToArray(entryName)).toString(16))]: abiEntryMod
|
|
29311
29343
|
};
|
|
29312
29344
|
}, {});
|
|
29313
29345
|
}
|