starknet 10.0.4 → 10.1.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.
@@ -114,12 +114,13 @@ var starknet = (() => {
114
114
  Provider: () => RpcProvider,
115
115
  ProviderInterface: () => ProviderInterface,
116
116
  RPC: () => api_exports3,
117
- RPC0101: () => rpc_0_10_2_exports,
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: () => RpcChannel2,
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
- RPCSPEC0101: () => esm_exports2,
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-0101/dist/esm/index.js
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-0101/dist/esm/api/index.js
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-0101/dist/esm/api/constants.js
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-0101/dist/esm/api/contract.js
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-0101/dist/esm/snip-29/index.js
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-0101/dist/esm/wallet-api/index.js
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-0101/dist/esm/wallet-api/constants.js
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-0101/dist/esm/wallet-api/typedData.js
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",
@@ -11680,6 +11688,91 @@ ${indent}}` : "}";
11680
11688
  __export(rpc_0_10_2_exports, {
11681
11689
  RpcChannel: () => RpcChannel2
11682
11690
  });
11691
+
11692
+ // node_modules/@starknet-io/starknet-types-0101/dist/esm/api/constants.js
11693
+ var STATUS_ACCEPTED_ON_L23 = "ACCEPTED_ON_L2";
11694
+ var STATUS_ACCEPTED_ON_L13 = "ACCEPTED_ON_L1";
11695
+ var STATUS_RECEIVED3 = "RECEIVED";
11696
+ var STATUS_CANDIDATE3 = "CANDIDATE";
11697
+ var STATUS_PRE_CONFIRMED3 = "PRE_CONFIRMED";
11698
+ var STATUS_PRE_CONFIRMED_LOWERCASE3 = STATUS_PRE_CONFIRMED3.toLowerCase();
11699
+ var TXN_TYPE_DECLARE3 = "DECLARE";
11700
+ var TXN_TYPE_DEPLOY3 = "DEPLOY";
11701
+ var TXN_TYPE_DEPLOY_ACCOUNT3 = "DEPLOY_ACCOUNT";
11702
+ var TXN_TYPE_INVOKE3 = "INVOKE";
11703
+ var TXN_TYPE_L1_HANDLER3 = "L1_HANDLER";
11704
+ var ETransactionType3 = {
11705
+ DECLARE: TXN_TYPE_DECLARE3,
11706
+ DEPLOY: TXN_TYPE_DEPLOY3,
11707
+ DEPLOY_ACCOUNT: TXN_TYPE_DEPLOY_ACCOUNT3,
11708
+ INVOKE: TXN_TYPE_INVOKE3,
11709
+ L1_HANDLER: TXN_TYPE_L1_HANDLER3
11710
+ };
11711
+ var ESimulationFlag3 = {
11712
+ SKIP_VALIDATE: "SKIP_VALIDATE",
11713
+ SKIP_FEE_CHARGE: "SKIP_FEE_CHARGE",
11714
+ RETURN_INITIAL_READS: "RETURN_INITIAL_READS"
11715
+ };
11716
+ var ETxnResponseFlag3 = {
11717
+ INCLUDE_PROOF_FACTS: "INCLUDE_PROOF_FACTS"
11718
+ };
11719
+ var ETraceFlag3 = {
11720
+ RETURN_INITIAL_READS: "RETURN_INITIAL_READS"
11721
+ };
11722
+ var ETransactionStatus4 = {
11723
+ RECEIVED: STATUS_RECEIVED3,
11724
+ CANDIDATE: STATUS_CANDIDATE3,
11725
+ PRE_CONFIRMED: STATUS_PRE_CONFIRMED3,
11726
+ ACCEPTED_ON_L2: STATUS_ACCEPTED_ON_L23,
11727
+ ACCEPTED_ON_L1: STATUS_ACCEPTED_ON_L13
11728
+ };
11729
+ var ETransactionFinalityStatus3 = {
11730
+ PRE_CONFIRMED: STATUS_PRE_CONFIRMED3,
11731
+ ACCEPTED_ON_L2: STATUS_ACCEPTED_ON_L23,
11732
+ ACCEPTED_ON_L1: STATUS_ACCEPTED_ON_L13
11733
+ };
11734
+ var ETransactionVersion6 = {
11735
+ /**
11736
+ * @deprecated Starknet 0.14 will not support this transaction
11737
+ */
11738
+ V0: "0x0",
11739
+ /**
11740
+ * @deprecated Starknet 0.14 will not support this transaction
11741
+ */
11742
+ V1: "0x1",
11743
+ /**
11744
+ * @deprecated Starknet 0.14 will not support this transaction
11745
+ */
11746
+ V2: "0x2",
11747
+ V3: "0x3",
11748
+ /**
11749
+ * @deprecated Starknet 0.14 will not support this transaction
11750
+ */
11751
+ F0: "0x100000000000000000000000000000000",
11752
+ /**
11753
+ * @deprecated Starknet 0.14 will not support this transaction
11754
+ */
11755
+ F1: "0x100000000000000000000000000000001",
11756
+ /**
11757
+ * @deprecated Starknet 0.14 will not support this transaction
11758
+ */
11759
+ F2: "0x100000000000000000000000000000002",
11760
+ F3: "0x100000000000000000000000000000003"
11761
+ };
11762
+ var ETransactionVersion24 = {
11763
+ V0: ETransactionVersion6.V0,
11764
+ V1: ETransactionVersion6.V1,
11765
+ V2: ETransactionVersion6.V2,
11766
+ F0: ETransactionVersion6.F0,
11767
+ F1: ETransactionVersion6.F1,
11768
+ F2: ETransactionVersion6.F2
11769
+ };
11770
+ var ETransactionVersion35 = {
11771
+ V3: ETransactionVersion6.V3,
11772
+ F3: ETransactionVersion6.F3
11773
+ };
11774
+
11775
+ // src/channel/rpc_0_10_2.ts
11683
11776
  var RpcChannel2 = class {
11684
11777
  id = "RPC0.10.2";
11685
11778
  /**
@@ -11899,7 +11992,7 @@ ${indent}}` : "}";
11899
11992
  */
11900
11993
  getBlockWithTxs(blockIdentifier = this.blockIdentifier, options) {
11901
11994
  const block_id = new Block(blockIdentifier).identifier;
11902
- const response_flags = options?.includeProofFacts ? [esm_exports2.ETxnResponseFlag.INCLUDE_PROOF_FACTS] : void 0;
11995
+ const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
11903
11996
  return this.fetchEndpoint("starknet_getBlockWithTxs", {
11904
11997
  block_id,
11905
11998
  ...response_flags && { response_flags }
@@ -11913,7 +12006,7 @@ ${indent}}` : "}";
11913
12006
  */
11914
12007
  getBlockWithReceipts(blockIdentifier = this.blockIdentifier, options) {
11915
12008
  const block_id = new Block(blockIdentifier).identifier;
11916
- const response_flags = options?.includeProofFacts ? [esm_exports2.ETxnResponseFlag.INCLUDE_PROOF_FACTS] : void 0;
12009
+ const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
11917
12010
  return this.fetchEndpoint("starknet_getBlockWithReceipts", {
11918
12011
  block_id,
11919
12012
  ...response_flags && { response_flags }
@@ -11936,7 +12029,7 @@ ${indent}}` : "}";
11936
12029
  */
11937
12030
  getBlockTransactionsTraces(blockIdentifier = this.blockIdentifier, options) {
11938
12031
  const block_id = new Block(blockIdentifier).identifier;
11939
- const trace_flags = options?.returnInitialReads ? [esm_exports2.ETraceFlag.RETURN_INITIAL_READS] : void 0;
12032
+ const trace_flags = options?.returnInitialReads ? [ETraceFlag3.RETURN_INITIAL_READS] : void 0;
11940
12033
  return this.fetchEndpoint("starknet_traceBlockTransactions", {
11941
12034
  block_id,
11942
12035
  ...trace_flags && { trace_flags }
@@ -11954,7 +12047,7 @@ ${indent}}` : "}";
11954
12047
  */
11955
12048
  getTransactionByHash(txHash, options) {
11956
12049
  const transaction_hash = toHex(txHash);
11957
- const response_flags = options?.includeProofFacts ? [esm_exports2.ETxnResponseFlag.INCLUDE_PROOF_FACTS] : void 0;
12050
+ const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
11958
12051
  return this.fetchEndpoint("starknet_getTransactionByHash", {
11959
12052
  transaction_hash,
11960
12053
  ...response_flags && { response_flags }
@@ -11969,7 +12062,7 @@ ${indent}}` : "}";
11969
12062
  */
11970
12063
  getTransactionByBlockIdAndIndex(blockIdentifier, index, options) {
11971
12064
  const block_id = new Block(blockIdentifier).identifier;
11972
- const response_flags = options?.includeProofFacts ? [esm_exports2.ETxnResponseFlag.INCLUDE_PROOF_FACTS] : void 0;
12065
+ const response_flags = options?.includeProofFacts ? [ETxnResponseFlag3.INCLUDE_PROOF_FACTS] : void 0;
11973
12066
  return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex", {
11974
12067
  block_id,
11975
12068
  index,
@@ -12010,9 +12103,9 @@ ${indent}}` : "}";
12010
12103
  } = simulateTransactionOptions;
12011
12104
  const block_id = new Block(blockIdentifier).identifier;
12012
12105
  const simulationFlags = [];
12013
- if (skipValidate) simulationFlags.push(esm_exports2.ESimulationFlag.SKIP_VALIDATE);
12014
- if (skipFeeCharge) simulationFlags.push(esm_exports2.ESimulationFlag.SKIP_FEE_CHARGE);
12015
- const trace_flags = returnInitialReads ? [esm_exports2.ETraceFlag.RETURN_INITIAL_READS] : void 0;
12106
+ if (skipValidate) simulationFlags.push(ESimulationFlag3.SKIP_VALIDATE);
12107
+ if (skipFeeCharge) simulationFlags.push(ESimulationFlag3.SKIP_FEE_CHARGE);
12108
+ const trace_flags = returnInitialReads ? [ETraceFlag3.RETURN_INITIAL_READS] : void 0;
12016
12109
  return this.fetchEndpoint("starknet_simulateTransactions", {
12017
12110
  block_id,
12018
12111
  transactions: await Promise.all(invocations.map((it) => this.buildTransaction(it))),
@@ -12030,13 +12123,13 @@ ${indent}}` : "}";
12030
12123
  const errorStates = options?.errorStates ?? [];
12031
12124
  const successStates = options?.successStates ?? [
12032
12125
  // RPC.ETransactionExecutionStatus.SUCCEEDED, // UDC on SUCCEEDED + pre_confirmed had no proper events to parse UDC
12033
- esm_exports2.ETransactionFinalityStatus.ACCEPTED_ON_L2,
12034
- esm_exports2.ETransactionFinalityStatus.ACCEPTED_ON_L1
12126
+ ETransactionFinalityStatus3.ACCEPTED_ON_L2,
12127
+ ETransactionFinalityStatus3.ACCEPTED_ON_L1
12035
12128
  ];
12036
12129
  const errorMessages = {
12037
- [esm_exports2.ETransactionStatus.RECEIVED]: SYSTEM_MESSAGES.txEvictedFromMempool,
12038
- [esm_exports2.ETransactionStatus.PRE_CONFIRMED]: SYSTEM_MESSAGES.consensusFailed,
12039
- [esm_exports2.ETransactionStatus.CANDIDATE]: SYSTEM_MESSAGES.txFailsBlockBuildingValidation
12130
+ [ETransactionStatus4.RECEIVED]: SYSTEM_MESSAGES.txEvictedFromMempool,
12131
+ [ETransactionStatus4.PRE_CONFIRMED]: SYSTEM_MESSAGES.consensusFailed,
12132
+ [ETransactionStatus4.CANDIDATE]: SYSTEM_MESSAGES.txFailsBlockBuildingValidation
12040
12133
  };
12041
12134
  const txLife = [];
12042
12135
  let txStatus;
@@ -12133,7 +12226,7 @@ ${indent}}` : "}";
12133
12226
  const { blockIdentifier = this.blockIdentifier, skipValidate = methodDefaults.skipValidate } = options;
12134
12227
  const block_id = new Block(blockIdentifier).identifier;
12135
12228
  const flags = {
12136
- simulation_flags: skipValidate ? [esm_exports2.ESimulationFlag.SKIP_VALIDATE] : []
12229
+ simulation_flags: skipValidate ? [ESimulationFlag3.SKIP_VALIDATE] : []
12137
12230
  };
12138
12231
  return this.fetchEndpoint("starknet_estimateFee", {
12139
12232
  request: await Promise.all(invocations.map((it) => this.buildTransaction(it, "fee"))),
@@ -12247,7 +12340,7 @@ ${indent}}` : "}";
12247
12340
  };
12248
12341
  if (invocation.type === ETransactionType2.INVOKE) {
12249
12342
  const btx = {
12250
- type: esm_exports2.ETransactionType.INVOKE,
12343
+ type: ETransactionType3.INVOKE,
12251
12344
  sender_address: invocation.contractAddress,
12252
12345
  calldata: CallData.toHex(invocation.calldata),
12253
12346
  ...details,
@@ -12289,6 +12382,16 @@ ${indent}}` : "}";
12289
12382
  }
12290
12383
  };
12291
12384
 
12385
+ // src/channel/rpc_0_10_3.ts
12386
+ var rpc_0_10_3_exports = {};
12387
+ __export(rpc_0_10_3_exports, {
12388
+ RpcChannel: () => RpcChannel3
12389
+ });
12390
+ var RpcChannel3 = class extends RpcChannel2 {
12391
+ id = "RPC0.10.3";
12392
+ channelSpecVersion = _SupportedRpcVersion.v0_10_3;
12393
+ };
12394
+
12292
12395
  // src/utils/eventEmitter.ts
12293
12396
  var EventEmitter = class {
12294
12397
  listeners = {};
@@ -14560,12 +14663,12 @@ ${indent}}` : "}";
14560
14663
  if (isVersion("0.9", options.specVersion)) {
14561
14664
  this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
14562
14665
  } else if (isVersion("0.10", options.specVersion)) {
14563
- this.channel = new rpc_0_10_2_exports.RpcChannel({ ...options, waitMode: false });
14666
+ this.channel = new rpc_0_10_3_exports.RpcChannel({ ...options, waitMode: false });
14564
14667
  } else throw new Error(`unsupported channel for spec version: ${options.specVersion}`);
14565
14668
  } else if (isVersion("0.9", config.get("rpcVersion"))) {
14566
14669
  this.channel = new rpc_0_9_0_exports.RpcChannel({ ...options, waitMode: false });
14567
14670
  } else if (isVersion("0.10", config.get("rpcVersion"))) {
14568
- this.channel = new rpc_0_10_2_exports.RpcChannel({ ...options, waitMode: false });
14671
+ this.channel = new rpc_0_10_3_exports.RpcChannel({ ...options, waitMode: false });
14569
14672
  } else throw new Error("unable to define spec version for channel");
14570
14673
  this.responseParser = new RPCResponseParser(options?.resourceBoundsOverhead);
14571
14674
  const plugins = options?.plugins === false ? [] : options?.plugins ?? defaultPlugins;
@@ -14594,7 +14697,7 @@ ${indent}}` : "}";
14594
14697
  if (isVersion("0.10", spec)) {
14595
14698
  return new this({
14596
14699
  ...optionsOrProvider,
14597
- specVersion: _SupportedRpcVersion.v0_10_2
14700
+ specVersion: _SupportedRpcVersion.v0_10_3
14598
14701
  });
14599
14702
  }
14600
14703
  throw new LibraryError(