starknet 10.0.4 → 10.2.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 +12 -0
- package/README.md +2 -2
- package/dist/index.d.ts +245 -211
- package/dist/index.global.js +187 -59
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +105 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +103 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.global.js
CHANGED
|
@@ -114,12 +114,13 @@ var starknet = (() => {
|
|
|
114
114
|
Provider: () => RpcProvider,
|
|
115
115
|
ProviderInterface: () => ProviderInterface,
|
|
116
116
|
RPC: () => api_exports3,
|
|
117
|
-
|
|
117
|
+
RPC0102: () => rpc_0_10_2_exports,
|
|
118
|
+
RPC0103: () => rpc_0_10_3_exports,
|
|
118
119
|
RPC09: () => rpc_0_9_0_exports,
|
|
119
120
|
RPCResponseParser: () => RPCResponseParser,
|
|
120
121
|
ReceiptTx: () => ReceiptTx,
|
|
121
122
|
ResponseParser: () => ResponseParser,
|
|
122
|
-
RpcChannel: () =>
|
|
123
|
+
RpcChannel: () => RpcChannel3,
|
|
123
124
|
RpcError: () => RpcError,
|
|
124
125
|
RpcProvider: () => RpcProvider,
|
|
125
126
|
Signer: () => Signer,
|
|
@@ -292,8 +293,9 @@ var starknet = (() => {
|
|
|
292
293
|
PAYMASTER_API: () => snip_29_exports2,
|
|
293
294
|
PRICE_UNIT_FRI: () => PRICE_UNIT_FRI2,
|
|
294
295
|
PRICE_UNIT_WEI: () => PRICE_UNIT_WEI2,
|
|
296
|
+
PROVING_API: () => proving_api_exports,
|
|
295
297
|
Permission: () => Permission2,
|
|
296
|
-
|
|
298
|
+
RPCSPEC0103: () => esm_exports2,
|
|
297
299
|
RPCSPEC09: () => esm_exports,
|
|
298
300
|
STATE_MUTABILITY_EXTERNAL: () => STATE_MUTABILITY_EXTERNAL2,
|
|
299
301
|
STATE_MUTABILITY_VIEW: () => STATE_MUTABILITY_VIEW2,
|
|
@@ -561,7 +563,7 @@ var starknet = (() => {
|
|
|
561
563
|
// node_modules/@starknet-io/starknet-types-09/dist/esm/snip-29/index.js
|
|
562
564
|
var snip_29_exports = {};
|
|
563
565
|
|
|
564
|
-
// node_modules/@starknet-io/starknet-types-
|
|
566
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/index.js
|
|
565
567
|
var esm_exports2 = {};
|
|
566
568
|
__export(esm_exports2, {
|
|
567
569
|
ABI_TYPE_CONSTRUCTOR: () => ABI_TYPE_CONSTRUCTOR2,
|
|
@@ -592,6 +594,7 @@ var starknet = (() => {
|
|
|
592
594
|
PAYMASTER_API: () => snip_29_exports2,
|
|
593
595
|
PRICE_UNIT_FRI: () => PRICE_UNIT_FRI2,
|
|
594
596
|
PRICE_UNIT_WEI: () => PRICE_UNIT_WEI2,
|
|
597
|
+
PROVING_API: () => proving_api_exports,
|
|
595
598
|
Permission: () => Permission2,
|
|
596
599
|
STATE_MUTABILITY_EXTERNAL: () => STATE_MUTABILITY_EXTERNAL2,
|
|
597
600
|
STATE_MUTABILITY_VIEW: () => STATE_MUTABILITY_VIEW2,
|
|
@@ -613,7 +616,7 @@ var starknet = (() => {
|
|
|
613
616
|
WALLET_API: () => wallet_api_exports2
|
|
614
617
|
});
|
|
615
618
|
|
|
616
|
-
// node_modules/@starknet-io/starknet-types-
|
|
619
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/api/index.js
|
|
617
620
|
var api_exports2 = {};
|
|
618
621
|
__export(api_exports2, {
|
|
619
622
|
ABI_TYPE_CONSTRUCTOR: () => ABI_TYPE_CONSTRUCTOR2,
|
|
@@ -660,7 +663,7 @@ var starknet = (() => {
|
|
|
660
663
|
TXN_TYPE_L1_HANDLER: () => TXN_TYPE_L1_HANDLER2
|
|
661
664
|
});
|
|
662
665
|
|
|
663
|
-
// node_modules/@starknet-io/starknet-types-
|
|
666
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/api/constants.js
|
|
664
667
|
var STATUS_ACCEPTED_ON_L22 = "ACCEPTED_ON_L2";
|
|
665
668
|
var STATUS_ACCEPTED_ON_L12 = "ACCEPTED_ON_L1";
|
|
666
669
|
var STATUS_SUCCEEDED2 = "SUCCEEDED";
|
|
@@ -801,25 +804,28 @@ var starknet = (() => {
|
|
|
801
804
|
F3: ETransactionVersion4.F3
|
|
802
805
|
};
|
|
803
806
|
|
|
804
|
-
// node_modules/@starknet-io/starknet-types-
|
|
807
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/api/contract.js
|
|
805
808
|
var contract_exports2 = {};
|
|
806
809
|
|
|
807
|
-
// node_modules/@starknet-io/starknet-types-
|
|
810
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/snip-29/index.js
|
|
808
811
|
var snip_29_exports2 = {};
|
|
809
812
|
|
|
810
|
-
// node_modules/@starknet-io/starknet-types-
|
|
813
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/proving-api/index.js
|
|
814
|
+
var proving_api_exports = {};
|
|
815
|
+
|
|
816
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/wallet-api/index.js
|
|
811
817
|
var wallet_api_exports2 = {};
|
|
812
818
|
__export(wallet_api_exports2, {
|
|
813
819
|
Permission: () => Permission2,
|
|
814
820
|
TypedDataRevision: () => TypedDataRevision2
|
|
815
821
|
});
|
|
816
822
|
|
|
817
|
-
// node_modules/@starknet-io/starknet-types-
|
|
823
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/wallet-api/constants.js
|
|
818
824
|
var Permission2 = {
|
|
819
825
|
ACCOUNTS: "accounts"
|
|
820
826
|
};
|
|
821
827
|
|
|
822
|
-
// node_modules/@starknet-io/starknet-types-
|
|
828
|
+
// node_modules/@starknet-io/starknet-types-0103/dist/esm/wallet-api/typedData.js
|
|
823
829
|
var TypedDataRevision2 = {
|
|
824
830
|
ACTIVE: "1",
|
|
825
831
|
LEGACY: "0"
|
|
@@ -1258,9 +1264,11 @@ var starknet = (() => {
|
|
|
1258
1264
|
"0.9.0": "0.9.0",
|
|
1259
1265
|
"0.10.0": "0.10.0",
|
|
1260
1266
|
"0.10.2": "0.10.2",
|
|
1267
|
+
"0.10.3": "0.10.3",
|
|
1261
1268
|
v0_9_0: "0.9.0",
|
|
1262
1269
|
v0_10_0: "0.10.0",
|
|
1263
|
-
v0_10_2: "0.10.2"
|
|
1270
|
+
v0_10_2: "0.10.2",
|
|
1271
|
+
v0_10_3: "0.10.3"
|
|
1264
1272
|
};
|
|
1265
1273
|
var DEFAULT_GLOBAL_CONFIG = {
|
|
1266
1274
|
rpcVersion: "0.10.0",
|
|
@@ -6253,6 +6261,22 @@ ${indent}}` : "}";
|
|
|
6253
6261
|
}
|
|
6254
6262
|
};
|
|
6255
6263
|
|
|
6264
|
+
// src/utils/ec.ts
|
|
6265
|
+
var ec_exports = {};
|
|
6266
|
+
__export(ec_exports, {
|
|
6267
|
+
starkCurve: () => esm_exports4,
|
|
6268
|
+
weierstrass: () => weierstrass_exports
|
|
6269
|
+
});
|
|
6270
|
+
|
|
6271
|
+
// src/utils/hash/pedersenCore.ts
|
|
6272
|
+
function computePedersenHash(a, b) {
|
|
6273
|
+
return esm_exports4.pedersen(BigInt(a), BigInt(b));
|
|
6274
|
+
}
|
|
6275
|
+
function computeHashOnElements2(data) {
|
|
6276
|
+
return [...data, data.length].reduce((x, y) => esm_exports4.pedersen(BigInt(x), BigInt(y)), 0).toString();
|
|
6277
|
+
}
|
|
6278
|
+
var computePedersenHashOnElements = computeHashOnElements2;
|
|
6279
|
+
|
|
6256
6280
|
// src/utils/errors/rpc.ts
|
|
6257
6281
|
var errorCodes = {
|
|
6258
6282
|
FAILED_TO_RECEIVE_TXN: 1,
|
|
@@ -6547,6 +6571,31 @@ ${indent}}` : "}";
|
|
|
6547
6571
|
const allBytes = concatenateArrayBuffer(this.toElements());
|
|
6548
6572
|
return buffer_default.from(allBytes);
|
|
6549
6573
|
}
|
|
6574
|
+
/**
|
|
6575
|
+
* Compute the Pedersen hash of this ByteArray, following OpenZeppelin's `hash_byte_array` algorithm.
|
|
6576
|
+
*
|
|
6577
|
+
* Serializes the ByteArray to its felt252 components (data array length, each data chunk,
|
|
6578
|
+
* pending_word, pending_word_len), then chains Pedersen hash over all elements starting
|
|
6579
|
+
* from 0, and finalizes with the total element count.
|
|
6580
|
+
*
|
|
6581
|
+
* @returns {string} hex-string felt252 Pedersen hash of the ByteArray
|
|
6582
|
+
* @example
|
|
6583
|
+
* ```typescript
|
|
6584
|
+
* const ba = new CairoByteArray('Hello');
|
|
6585
|
+
* const result = ba.hash();
|
|
6586
|
+
* // result = 0x15d19ad651ffaf8e90a13938db2081fa3ff01de0712e00cbe69891bace66c51
|
|
6587
|
+
* ```
|
|
6588
|
+
*/
|
|
6589
|
+
hash() {
|
|
6590
|
+
this.assertInitialized();
|
|
6591
|
+
const serialized = [
|
|
6592
|
+
addHexPrefix(this.data.length.toString(16)),
|
|
6593
|
+
...this.data.flatMap((bytes31) => bytes31.toApiRequest()),
|
|
6594
|
+
...this.pending_word.toApiRequest(),
|
|
6595
|
+
...this.pending_word_len.toApiRequest()
|
|
6596
|
+
];
|
|
6597
|
+
return computeHashOnElements2(serialized);
|
|
6598
|
+
}
|
|
6550
6599
|
/**
|
|
6551
6600
|
* returns an array of all the data chunks and the pending word
|
|
6552
6601
|
* when concatenated, represents the original bytes sequence
|
|
@@ -9107,7 +9156,7 @@ ${indent}}` : "}";
|
|
|
9107
9156
|
computeCompiledClassHashBlake: () => computeCompiledClassHashBlake,
|
|
9108
9157
|
computeCompiledClassHashPoseidon: () => computeCompiledClassHashPoseidon,
|
|
9109
9158
|
computeContractClassHash: () => computeContractClassHash,
|
|
9110
|
-
computeHashOnElements: () =>
|
|
9159
|
+
computeHashOnElements: () => computeHashOnElements2,
|
|
9111
9160
|
computeHintedClassHash: () => computeHintedClassHash,
|
|
9112
9161
|
computeLegacyContractClassHash: () => computeLegacyContractClassHash,
|
|
9113
9162
|
computePedersenHash: () => computePedersenHash,
|
|
@@ -9245,22 +9294,13 @@ ${indent}}` : "}";
|
|
|
9245
9294
|
calculateL2MessageTxHash: () => calculateL2MessageTxHash,
|
|
9246
9295
|
calculateTransactionHash: () => calculateTransactionHash,
|
|
9247
9296
|
calculateTransactionHashCommon: () => calculateTransactionHashCommon2,
|
|
9248
|
-
computeHashOnElements: () =>
|
|
9297
|
+
computeHashOnElements: () => computeHashOnElements3
|
|
9249
9298
|
});
|
|
9250
|
-
|
|
9251
|
-
// src/utils/ec.ts
|
|
9252
|
-
var ec_exports = {};
|
|
9253
|
-
__export(ec_exports, {
|
|
9254
|
-
starkCurve: () => esm_exports4,
|
|
9255
|
-
weierstrass: () => weierstrass_exports
|
|
9256
|
-
});
|
|
9257
|
-
|
|
9258
|
-
// src/utils/hash/transactionHash/v2.ts
|
|
9259
|
-
function computeHashOnElements2(data) {
|
|
9299
|
+
function computeHashOnElements3(data) {
|
|
9260
9300
|
return [...data, data.length].reduce((x, y) => esm_exports4.pedersen(toBigInt(x), toBigInt(y)), 0).toString();
|
|
9261
9301
|
}
|
|
9262
9302
|
function calculateTransactionHashCommon2(txHashPrefix, version, contractAddress, entryPointSelector, calldata, maxFee, chainId, additionalData = []) {
|
|
9263
|
-
const calldataHash =
|
|
9303
|
+
const calldataHash = computeHashOnElements3(calldata);
|
|
9264
9304
|
const dataToHash = [
|
|
9265
9305
|
txHashPrefix,
|
|
9266
9306
|
version,
|
|
@@ -9271,7 +9311,7 @@ ${indent}}` : "}";
|
|
|
9271
9311
|
chainId,
|
|
9272
9312
|
...additionalData
|
|
9273
9313
|
];
|
|
9274
|
-
return
|
|
9314
|
+
return computeHashOnElements3(dataToHash);
|
|
9275
9315
|
}
|
|
9276
9316
|
function calculateDeclareTransactionHash2(classHash, senderAddress, version, maxFee, chainId, nonce, compiledClassHash) {
|
|
9277
9317
|
return calculateTransactionHashCommon2(
|
|
@@ -9430,18 +9470,11 @@ ${indent}}` : "}";
|
|
|
9430
9470
|
}
|
|
9431
9471
|
|
|
9432
9472
|
// src/utils/hash/classHash/pedersen.ts
|
|
9433
|
-
function computePedersenHash(a, b) {
|
|
9434
|
-
return esm_exports4.pedersen(BigInt(a), BigInt(b));
|
|
9435
|
-
}
|
|
9436
|
-
function computeHashOnElements3(data) {
|
|
9437
|
-
return [...data, data.length].reduce((x, y) => esm_exports4.pedersen(BigInt(x), BigInt(y)), 0).toString();
|
|
9438
|
-
}
|
|
9439
|
-
var computePedersenHashOnElements = computeHashOnElements3;
|
|
9440
9473
|
function calculateContractAddressFromHash(salt, classHash, constructorCalldata, deployerAddress) {
|
|
9441
9474
|
const compiledCalldata = CallData.compile(constructorCalldata);
|
|
9442
|
-
const constructorCalldataHash =
|
|
9475
|
+
const constructorCalldataHash = computeHashOnElements2(compiledCalldata);
|
|
9443
9476
|
const CONTRACT_ADDRESS_PREFIX = felt("0x535441524b4e45545f434f4e54524143545f41444452455353");
|
|
9444
|
-
const hash =
|
|
9477
|
+
const hash = computeHashOnElements2([
|
|
9445
9478
|
CONTRACT_ADDRESS_PREFIX,
|
|
9446
9479
|
deployerAddress,
|
|
9447
9480
|
salt,
|
|
@@ -9459,21 +9492,21 @@ ${indent}}` : "}";
|
|
|
9459
9492
|
function computeLegacyContractClassHash(contract) {
|
|
9460
9493
|
const compiledContract = isString(contract) ? parse2(contract) : contract;
|
|
9461
9494
|
const apiVersion = toHex(API_VERSION);
|
|
9462
|
-
const externalEntryPointsHash =
|
|
9495
|
+
const externalEntryPointsHash = computeHashOnElements2(
|
|
9463
9496
|
compiledContract.entry_points_by_type.EXTERNAL.flatMap((e) => [e.selector, e.offset])
|
|
9464
9497
|
);
|
|
9465
|
-
const l1HandlerEntryPointsHash =
|
|
9498
|
+
const l1HandlerEntryPointsHash = computeHashOnElements2(
|
|
9466
9499
|
compiledContract.entry_points_by_type.L1_HANDLER.flatMap((e) => [e.selector, e.offset])
|
|
9467
9500
|
);
|
|
9468
|
-
const constructorEntryPointHash =
|
|
9501
|
+
const constructorEntryPointHash = computeHashOnElements2(
|
|
9469
9502
|
compiledContract.entry_points_by_type.CONSTRUCTOR.flatMap((e) => [e.selector, e.offset])
|
|
9470
9503
|
);
|
|
9471
|
-
const builtinsHash =
|
|
9504
|
+
const builtinsHash = computeHashOnElements2(
|
|
9472
9505
|
compiledContract.program.builtins.map((s) => encodeShortString(s))
|
|
9473
9506
|
);
|
|
9474
9507
|
const hintedClassHash = computeHintedClassHash(compiledContract);
|
|
9475
|
-
const dataHash =
|
|
9476
|
-
return
|
|
9508
|
+
const dataHash = computeHashOnElements2(compiledContract.program.data);
|
|
9509
|
+
return computeHashOnElements2([
|
|
9477
9510
|
apiVersion,
|
|
9478
9511
|
externalEntryPointsHash,
|
|
9479
9512
|
l1HandlerEntryPointsHash,
|
|
@@ -11680,6 +11713,91 @@ ${indent}}` : "}";
|
|
|
11680
11713
|
__export(rpc_0_10_2_exports, {
|
|
11681
11714
|
RpcChannel: () => RpcChannel2
|
|
11682
11715
|
});
|
|
11716
|
+
|
|
11717
|
+
// node_modules/@starknet-io/starknet-types-0101/dist/esm/api/constants.js
|
|
11718
|
+
var STATUS_ACCEPTED_ON_L23 = "ACCEPTED_ON_L2";
|
|
11719
|
+
var STATUS_ACCEPTED_ON_L13 = "ACCEPTED_ON_L1";
|
|
11720
|
+
var STATUS_RECEIVED3 = "RECEIVED";
|
|
11721
|
+
var STATUS_CANDIDATE3 = "CANDIDATE";
|
|
11722
|
+
var STATUS_PRE_CONFIRMED3 = "PRE_CONFIRMED";
|
|
11723
|
+
var STATUS_PRE_CONFIRMED_LOWERCASE3 = STATUS_PRE_CONFIRMED3.toLowerCase();
|
|
11724
|
+
var TXN_TYPE_DECLARE3 = "DECLARE";
|
|
11725
|
+
var TXN_TYPE_DEPLOY3 = "DEPLOY";
|
|
11726
|
+
var TXN_TYPE_DEPLOY_ACCOUNT3 = "DEPLOY_ACCOUNT";
|
|
11727
|
+
var TXN_TYPE_INVOKE3 = "INVOKE";
|
|
11728
|
+
var TXN_TYPE_L1_HANDLER3 = "L1_HANDLER";
|
|
11729
|
+
var ETransactionType3 = {
|
|
11730
|
+
DECLARE: TXN_TYPE_DECLARE3,
|
|
11731
|
+
DEPLOY: TXN_TYPE_DEPLOY3,
|
|
11732
|
+
DEPLOY_ACCOUNT: TXN_TYPE_DEPLOY_ACCOUNT3,
|
|
11733
|
+
INVOKE: TXN_TYPE_INVOKE3,
|
|
11734
|
+
L1_HANDLER: TXN_TYPE_L1_HANDLER3
|
|
11735
|
+
};
|
|
11736
|
+
var ESimulationFlag3 = {
|
|
11737
|
+
SKIP_VALIDATE: "SKIP_VALIDATE",
|
|
11738
|
+
SKIP_FEE_CHARGE: "SKIP_FEE_CHARGE",
|
|
11739
|
+
RETURN_INITIAL_READS: "RETURN_INITIAL_READS"
|
|
11740
|
+
};
|
|
11741
|
+
var ETxnResponseFlag3 = {
|
|
11742
|
+
INCLUDE_PROOF_FACTS: "INCLUDE_PROOF_FACTS"
|
|
11743
|
+
};
|
|
11744
|
+
var ETraceFlag3 = {
|
|
11745
|
+
RETURN_INITIAL_READS: "RETURN_INITIAL_READS"
|
|
11746
|
+
};
|
|
11747
|
+
var ETransactionStatus4 = {
|
|
11748
|
+
RECEIVED: STATUS_RECEIVED3,
|
|
11749
|
+
CANDIDATE: STATUS_CANDIDATE3,
|
|
11750
|
+
PRE_CONFIRMED: STATUS_PRE_CONFIRMED3,
|
|
11751
|
+
ACCEPTED_ON_L2: STATUS_ACCEPTED_ON_L23,
|
|
11752
|
+
ACCEPTED_ON_L1: STATUS_ACCEPTED_ON_L13
|
|
11753
|
+
};
|
|
11754
|
+
var ETransactionFinalityStatus3 = {
|
|
11755
|
+
PRE_CONFIRMED: STATUS_PRE_CONFIRMED3,
|
|
11756
|
+
ACCEPTED_ON_L2: STATUS_ACCEPTED_ON_L23,
|
|
11757
|
+
ACCEPTED_ON_L1: STATUS_ACCEPTED_ON_L13
|
|
11758
|
+
};
|
|
11759
|
+
var ETransactionVersion6 = {
|
|
11760
|
+
/**
|
|
11761
|
+
* @deprecated Starknet 0.14 will not support this transaction
|
|
11762
|
+
*/
|
|
11763
|
+
V0: "0x0",
|
|
11764
|
+
/**
|
|
11765
|
+
* @deprecated Starknet 0.14 will not support this transaction
|
|
11766
|
+
*/
|
|
11767
|
+
V1: "0x1",
|
|
11768
|
+
/**
|
|
11769
|
+
* @deprecated Starknet 0.14 will not support this transaction
|
|
11770
|
+
*/
|
|
11771
|
+
V2: "0x2",
|
|
11772
|
+
V3: "0x3",
|
|
11773
|
+
/**
|
|
11774
|
+
* @deprecated Starknet 0.14 will not support this transaction
|
|
11775
|
+
*/
|
|
11776
|
+
F0: "0x100000000000000000000000000000000",
|
|
11777
|
+
/**
|
|
11778
|
+
* @deprecated Starknet 0.14 will not support this transaction
|
|
11779
|
+
*/
|
|
11780
|
+
F1: "0x100000000000000000000000000000001",
|
|
11781
|
+
/**
|
|
11782
|
+
* @deprecated Starknet 0.14 will not support this transaction
|
|
11783
|
+
*/
|
|
11784
|
+
F2: "0x100000000000000000000000000000002",
|
|
11785
|
+
F3: "0x100000000000000000000000000000003"
|
|
11786
|
+
};
|
|
11787
|
+
var ETransactionVersion24 = {
|
|
11788
|
+
V0: ETransactionVersion6.V0,
|
|
11789
|
+
V1: ETransactionVersion6.V1,
|
|
11790
|
+
V2: ETransactionVersion6.V2,
|
|
11791
|
+
F0: ETransactionVersion6.F0,
|
|
11792
|
+
F1: ETransactionVersion6.F1,
|
|
11793
|
+
F2: ETransactionVersion6.F2
|
|
11794
|
+
};
|
|
11795
|
+
var ETransactionVersion35 = {
|
|
11796
|
+
V3: ETransactionVersion6.V3,
|
|
11797
|
+
F3: ETransactionVersion6.F3
|
|
11798
|
+
};
|
|
11799
|
+
|
|
11800
|
+
// src/channel/rpc_0_10_2.ts
|
|
11683
11801
|
var RpcChannel2 = class {
|
|
11684
11802
|
id = "RPC0.10.2";
|
|
11685
11803
|
/**
|
|
@@ -11899,7 +12017,7 @@ ${indent}}` : "}";
|
|
|
11899
12017
|
*/
|
|
11900
12018
|
getBlockWithTxs(blockIdentifier = this.blockIdentifier, options) {
|
|
11901
12019
|
const block_id = new Block(blockIdentifier).identifier;
|
|
11902
|
-
const response_flags = options?.includeProofFacts ? [
|
|
12020
|
+
const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
|
|
11903
12021
|
return this.fetchEndpoint("starknet_getBlockWithTxs", {
|
|
11904
12022
|
block_id,
|
|
11905
12023
|
...response_flags && { response_flags }
|
|
@@ -11913,7 +12031,7 @@ ${indent}}` : "}";
|
|
|
11913
12031
|
*/
|
|
11914
12032
|
getBlockWithReceipts(blockIdentifier = this.blockIdentifier, options) {
|
|
11915
12033
|
const block_id = new Block(blockIdentifier).identifier;
|
|
11916
|
-
const response_flags = options?.includeProofFacts ? [
|
|
12034
|
+
const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
|
|
11917
12035
|
return this.fetchEndpoint("starknet_getBlockWithReceipts", {
|
|
11918
12036
|
block_id,
|
|
11919
12037
|
...response_flags && { response_flags }
|
|
@@ -11936,7 +12054,7 @@ ${indent}}` : "}";
|
|
|
11936
12054
|
*/
|
|
11937
12055
|
getBlockTransactionsTraces(blockIdentifier = this.blockIdentifier, options) {
|
|
11938
12056
|
const block_id = new Block(blockIdentifier).identifier;
|
|
11939
|
-
const trace_flags = options?.returnInitialReads ? [
|
|
12057
|
+
const trace_flags = options?.returnInitialReads ? [ETraceFlag3.RETURN_INITIAL_READS] : void 0;
|
|
11940
12058
|
return this.fetchEndpoint("starknet_traceBlockTransactions", {
|
|
11941
12059
|
block_id,
|
|
11942
12060
|
...trace_flags && { trace_flags }
|
|
@@ -11954,7 +12072,7 @@ ${indent}}` : "}";
|
|
|
11954
12072
|
*/
|
|
11955
12073
|
getTransactionByHash(txHash, options) {
|
|
11956
12074
|
const transaction_hash = toHex(txHash);
|
|
11957
|
-
const response_flags = options?.includeProofFacts ? [
|
|
12075
|
+
const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
|
|
11958
12076
|
return this.fetchEndpoint("starknet_getTransactionByHash", {
|
|
11959
12077
|
transaction_hash,
|
|
11960
12078
|
...response_flags && { response_flags }
|
|
@@ -11969,7 +12087,7 @@ ${indent}}` : "}";
|
|
|
11969
12087
|
*/
|
|
11970
12088
|
getTransactionByBlockIdAndIndex(blockIdentifier, index, options) {
|
|
11971
12089
|
const block_id = new Block(blockIdentifier).identifier;
|
|
11972
|
-
const response_flags = options?.includeProofFacts ? [
|
|
12090
|
+
const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
|
|
11973
12091
|
return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex", {
|
|
11974
12092
|
block_id,
|
|
11975
12093
|
index,
|
|
@@ -12010,9 +12128,9 @@ ${indent}}` : "}";
|
|
|
12010
12128
|
} = simulateTransactionOptions;
|
|
12011
12129
|
const block_id = new Block(blockIdentifier).identifier;
|
|
12012
12130
|
const simulationFlags = [];
|
|
12013
|
-
if (skipValidate) simulationFlags.push(
|
|
12014
|
-
if (skipFeeCharge) simulationFlags.push(
|
|
12015
|
-
const trace_flags = returnInitialReads ? [
|
|
12131
|
+
if (skipValidate) simulationFlags.push(ESimulationFlag3.SKIP_VALIDATE);
|
|
12132
|
+
if (skipFeeCharge) simulationFlags.push(ESimulationFlag3.SKIP_FEE_CHARGE);
|
|
12133
|
+
const trace_flags = returnInitialReads ? [ETraceFlag3.RETURN_INITIAL_READS] : void 0;
|
|
12016
12134
|
return this.fetchEndpoint("starknet_simulateTransactions", {
|
|
12017
12135
|
block_id,
|
|
12018
12136
|
transactions: await Promise.all(invocations.map((it) => this.buildTransaction(it))),
|
|
@@ -12030,13 +12148,13 @@ ${indent}}` : "}";
|
|
|
12030
12148
|
const errorStates = options?.errorStates ?? [];
|
|
12031
12149
|
const successStates = options?.successStates ?? [
|
|
12032
12150
|
// RPC.ETransactionExecutionStatus.SUCCEEDED, // UDC on SUCCEEDED + pre_confirmed had no proper events to parse UDC
|
|
12033
|
-
|
|
12034
|
-
|
|
12151
|
+
ETransactionFinalityStatus3.ACCEPTED_ON_L2,
|
|
12152
|
+
ETransactionFinalityStatus3.ACCEPTED_ON_L1
|
|
12035
12153
|
];
|
|
12036
12154
|
const errorMessages = {
|
|
12037
|
-
[
|
|
12038
|
-
[
|
|
12039
|
-
[
|
|
12155
|
+
[ETransactionStatus4.RECEIVED]: SYSTEM_MESSAGES.txEvictedFromMempool,
|
|
12156
|
+
[ETransactionStatus4.PRE_CONFIRMED]: SYSTEM_MESSAGES.consensusFailed,
|
|
12157
|
+
[ETransactionStatus4.CANDIDATE]: SYSTEM_MESSAGES.txFailsBlockBuildingValidation
|
|
12040
12158
|
};
|
|
12041
12159
|
const txLife = [];
|
|
12042
12160
|
let txStatus;
|
|
@@ -12133,7 +12251,7 @@ ${indent}}` : "}";
|
|
|
12133
12251
|
const { blockIdentifier = this.blockIdentifier, skipValidate = methodDefaults.skipValidate } = options;
|
|
12134
12252
|
const block_id = new Block(blockIdentifier).identifier;
|
|
12135
12253
|
const flags = {
|
|
12136
|
-
simulation_flags: skipValidate ? [
|
|
12254
|
+
simulation_flags: skipValidate ? [ESimulationFlag3.SKIP_VALIDATE] : []
|
|
12137
12255
|
};
|
|
12138
12256
|
return this.fetchEndpoint("starknet_estimateFee", {
|
|
12139
12257
|
request: await Promise.all(invocations.map((it) => this.buildTransaction(it, "fee"))),
|
|
@@ -12247,7 +12365,7 @@ ${indent}}` : "}";
|
|
|
12247
12365
|
};
|
|
12248
12366
|
if (invocation.type === ETransactionType2.INVOKE) {
|
|
12249
12367
|
const btx = {
|
|
12250
|
-
type:
|
|
12368
|
+
type: ETransactionType3.INVOKE,
|
|
12251
12369
|
sender_address: invocation.contractAddress,
|
|
12252
12370
|
calldata: CallData.toHex(invocation.calldata),
|
|
12253
12371
|
...details,
|
|
@@ -12289,6 +12407,16 @@ ${indent}}` : "}";
|
|
|
12289
12407
|
}
|
|
12290
12408
|
};
|
|
12291
12409
|
|
|
12410
|
+
// src/channel/rpc_0_10_3.ts
|
|
12411
|
+
var rpc_0_10_3_exports = {};
|
|
12412
|
+
__export(rpc_0_10_3_exports, {
|
|
12413
|
+
RpcChannel: () => RpcChannel3
|
|
12414
|
+
});
|
|
12415
|
+
var RpcChannel3 = class extends RpcChannel2 {
|
|
12416
|
+
id = "RPC0.10.3";
|
|
12417
|
+
channelSpecVersion = _SupportedRpcVersion.v0_10_3;
|
|
12418
|
+
};
|
|
12419
|
+
|
|
12292
12420
|
// src/utils/eventEmitter.ts
|
|
12293
12421
|
var EventEmitter = class {
|
|
12294
12422
|
listeners = {};
|
|
@@ -14560,12 +14688,12 @@ ${indent}}` : "}";
|
|
|
14560
14688
|
if (isVersion("0.9", options.specVersion)) {
|
|
14561
14689
|
this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
|
|
14562
14690
|
} else if (isVersion("0.10", options.specVersion)) {
|
|
14563
|
-
this.channel = new
|
|
14691
|
+
this.channel = new rpc_0_10_3_exports.RpcChannel({ ...options, waitMode: false });
|
|
14564
14692
|
} else throw new Error(`unsupported channel for spec version: ${options.specVersion}`);
|
|
14565
14693
|
} else if (isVersion("0.9", config.get("rpcVersion"))) {
|
|
14566
14694
|
this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
|
|
14567
14695
|
} else if (isVersion("0.10", config.get("rpcVersion"))) {
|
|
14568
|
-
this.channel = new
|
|
14696
|
+
this.channel = new rpc_0_10_3_exports.RpcChannel({ ...options, waitMode: false });
|
|
14569
14697
|
} else throw new Error("unable to define spec version for channel");
|
|
14570
14698
|
this.responseParser = new RPCResponseParser(options?.resourceBoundsOverhead);
|
|
14571
14699
|
const plugins = options?.plugins === false ? [] : options?.plugins ?? defaultPlugins;
|
|
@@ -14594,7 +14722,7 @@ ${indent}}` : "}";
|
|
|
14594
14722
|
if (isVersion("0.10", spec)) {
|
|
14595
14723
|
return new this({
|
|
14596
14724
|
...optionsOrProvider,
|
|
14597
|
-
specVersion: _SupportedRpcVersion.
|
|
14725
|
+
specVersion: _SupportedRpcVersion.v0_10_3
|
|
14598
14726
|
});
|
|
14599
14727
|
}
|
|
14600
14728
|
throw new LibraryError(
|