starknet 5.22.0 → 5.24.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/dist/index.d.ts CHANGED
@@ -153,6 +153,8 @@ declare const UDC: {
153
153
  ADDRESS: string;
154
154
  ENTRYPOINT: string;
155
155
  };
156
+ declare const RPC_GOERLI_NODES: string[];
157
+ declare const RPC_MAINNET_NODES: string[];
156
158
 
157
159
  declare const constants_API_VERSION: typeof API_VERSION;
158
160
  declare const constants_BN_FEE_TRANSACTION_VERSION_1: typeof BN_FEE_TRANSACTION_VERSION_1;
@@ -168,6 +170,8 @@ declare const constants_MASK_250: typeof MASK_250;
168
170
  declare const constants_MASK_251: typeof MASK_251;
169
171
  type constants_NetworkName = NetworkName;
170
172
  declare const constants_NetworkName: typeof NetworkName;
173
+ declare const constants_RPC_GOERLI_NODES: typeof RPC_GOERLI_NODES;
174
+ declare const constants_RPC_MAINNET_NODES: typeof RPC_MAINNET_NODES;
171
175
  type constants_StarknetChainId = StarknetChainId;
172
176
  declare const constants_StarknetChainId: typeof StarknetChainId;
173
177
  declare const constants_TEXT_TO_FELT_MAX_LEN: typeof TEXT_TO_FELT_MAX_LEN;
@@ -189,6 +193,8 @@ declare namespace constants {
189
193
  constants_MASK_250 as MASK_250,
190
194
  constants_MASK_251 as MASK_251,
191
195
  constants_NetworkName as NetworkName,
196
+ constants_RPC_GOERLI_NODES as RPC_GOERLI_NODES,
197
+ constants_RPC_MAINNET_NODES as RPC_MAINNET_NODES,
192
198
  constants_StarknetChainId as StarknetChainId,
193
199
  constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN,
194
200
  constants_TransactionHashPrefix as TransactionHashPrefix,
@@ -401,7 +407,7 @@ type EntryPointsByType = {
401
407
  };
402
408
  type ContractEntryPointFields = {
403
409
  selector: string;
404
- offset: string;
410
+ offset: string | number;
405
411
  builtins?: Builtins;
406
412
  };
407
413
  interface Program extends Record<string, any> {
@@ -415,7 +421,7 @@ type CairoAssembly = {
415
421
  compiler_version: string;
416
422
  bytecode: ByteCode;
417
423
  hints: any[];
418
- pythonic_hints: PythonicHints;
424
+ pythonic_hints?: PythonicHints;
419
425
  entry_points_by_type: EntryPointsByType;
420
426
  };
421
427
  /** COMPILED CONTRACT */
@@ -577,7 +583,7 @@ type Details = {
577
583
  type InvocationsDetailsWithNonce = InvocationsDetails & {
578
584
  nonce: BigNumberish;
579
585
  };
580
- declare enum TransactionType$1 {
586
+ declare enum TransactionType {
581
587
  DECLARE = "DECLARE",
582
588
  DEPLOY = "DEPLOY",
583
589
  DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT",
@@ -587,7 +593,7 @@ declare enum TransactionType$1 {
587
593
  * new statuses are defined by props: finality_status and execution_status
588
594
  * to be #deprecated
589
595
  */
590
- declare enum TransactionStatus {
596
+ declare enum TransactionStatus$1 {
591
597
  NOT_RECEIVED = "NOT_RECEIVED",
592
598
  RECEIVED = "RECEIVED",
593
599
  ACCEPTED_ON_L2 = "ACCEPTED_ON_L2",
@@ -595,13 +601,13 @@ declare enum TransactionStatus {
595
601
  REJECTED = "REJECTED",
596
602
  REVERTED = "REVERTED"
597
603
  }
598
- declare enum TransactionFinalityStatus$1 {
604
+ declare enum TransactionFinalityStatus {
599
605
  NOT_RECEIVED = "NOT_RECEIVED",
600
606
  RECEIVED = "RECEIVED",
601
607
  ACCEPTED_ON_L2 = "ACCEPTED_ON_L2",
602
608
  ACCEPTED_ON_L1 = "ACCEPTED_ON_L1"
603
609
  }
604
- declare enum TransactionExecutionStatus$1 {
610
+ declare enum TransactionExecutionStatus {
605
611
  REJECTED = "REJECTED",
606
612
  REVERTED = "REVERTED",
607
613
  SUCCEEDED = "SUCCEEDED"
@@ -627,11 +633,11 @@ type BlockIdentifier = BlockNumber | BigNumberish;
627
633
  * items used by AccountInvocations
628
634
  */
629
635
  type AccountInvocationItem = (({
630
- type: TransactionType$1.DECLARE;
636
+ type: TransactionType.DECLARE;
631
637
  } & DeclareContractTransaction) | ({
632
- type: TransactionType$1.DEPLOY_ACCOUNT;
638
+ type: TransactionType.DEPLOY_ACCOUNT;
633
639
  } & DeployAccountContractTransaction) | ({
634
- type: TransactionType$1.INVOKE;
640
+ type: TransactionType.INVOKE;
635
641
  } & Invocation)) & InvocationsDetailsWithNonce;
636
642
  /**
637
643
  * Complete invocations array with account details (internal type from account -> provider)
@@ -641,13 +647,13 @@ type AccountInvocations = AccountInvocationItem[];
641
647
  * Invocations array user provide to bulk method (simulate)
642
648
  */
643
649
  type Invocations = Array<({
644
- type: TransactionType$1.DECLARE;
650
+ type: TransactionType.DECLARE;
645
651
  } & OptionalPayload<DeclareContractPayload>) | ({
646
- type: TransactionType$1.DEPLOY;
652
+ type: TransactionType.DEPLOY;
647
653
  } & OptionalPayload<AllowArray<UniversalDeployerContractPayload>>) | ({
648
- type: TransactionType$1.DEPLOY_ACCOUNT;
654
+ type: TransactionType.DEPLOY_ACCOUNT;
649
655
  } & OptionalPayload<DeployAccountContractPayload>) | ({
650
- type: TransactionType$1.INVOKE;
656
+ type: TransactionType.INVOKE;
651
657
  } & OptionalPayload<AllowArray<Call>>)>;
652
658
  type Tupled = {
653
659
  element: any;
@@ -661,8 +667,8 @@ type ParsedStruct = {
661
667
  };
662
668
  type waitForTransactionOptions = {
663
669
  retryInterval?: number;
664
- successStates?: Array<TransactionFinalityStatus$1 | TransactionExecutionStatus$1>;
665
- errorStates?: Array<TransactionFinalityStatus$1 | TransactionExecutionStatus$1>;
670
+ successStates?: Array<TransactionFinalityStatus | TransactionExecutionStatus>;
671
+ errorStates?: Array<TransactionFinalityStatus | TransactionExecutionStatus>;
666
672
  };
667
673
  type getSimulateTransactionOptions = {
668
674
  blockIdentifier?: BlockIdentifier;
@@ -698,11 +704,12 @@ interface ProviderOptions {
698
704
  rpc?: RpcProviderOptions;
699
705
  }
700
706
  type RpcProviderOptions = {
701
- nodeUrl: string;
707
+ nodeUrl?: string | NetworkName;
702
708
  retries?: number;
703
709
  headers?: object;
704
710
  blockIdentifier?: BlockIdentifier;
705
711
  chainId?: StarknetChainId;
712
+ default?: boolean;
706
713
  };
707
714
  type SequencerHttpMethod = 'POST' | 'GET';
708
715
  type SequencerProviderOptions = {
@@ -717,109 +724,160 @@ type SequencerProviderOptions = {
717
724
  gatewayUrl?: string;
718
725
  });
719
726
 
727
+ type RequestBody = {
728
+ id: number | string;
729
+ jsonrpc: '2.0';
730
+ method: string;
731
+ params?: {};
732
+ };
733
+ type ResponseBody = {
734
+ id: number | string;
735
+ jsonrpc: '2.0';
736
+ } & (SuccessResponseBody | ErrorResponseBody);
737
+ type SuccessResponseBody = {
738
+ result: unknown;
739
+ };
740
+ type ErrorResponseBody = {
741
+ error: Error$1;
742
+ };
743
+ type Error$1 = {
744
+ code: number;
745
+ message: string;
746
+ data?: unknown;
747
+ };
748
+
749
+ type index$2_ErrorResponseBody = ErrorResponseBody;
750
+ type index$2_RequestBody = RequestBody;
751
+ type index$2_ResponseBody = ResponseBody;
752
+ type index$2_SuccessResponseBody = SuccessResponseBody;
753
+ declare namespace index$2 {
754
+ export {
755
+ Error$1 as Error,
756
+ index$2_ErrorResponseBody as ErrorResponseBody,
757
+ index$2_RequestBody as RequestBody,
758
+ index$2_ResponseBody as ResponseBody,
759
+ index$2_SuccessResponseBody as SuccessResponseBody,
760
+ };
761
+ }
762
+
720
763
  /**
721
- * TypeScript Representation of 'starknet-specs' (OpenRpc protocol types)
722
- * https://github.com/starkware-libs/starknet-specs/tree/v0.4.0-rc3
723
- *
724
- * Starknet Node Read API 0.4.0 - rpc tag v0.4.0-rc3
725
- * Starknet Node Write API 0.4.0 - rpc tag v0.4.0-rc3
726
- * Starknet Node Trace API 0.4.0 - rpc tag v0.4.0-rc3
764
+ * PRIMITIVES
727
765
  */
728
766
  /**
729
767
  * A field element. represented by at most 63 hex digits
730
768
  * @pattern ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
731
769
  */
732
770
  type FELT = string;
733
- type ADDRESS = FELT;
734
- type NUM_AS_HEX = string;
735
- type SIGNATURE = Array<FELT>;
736
771
  /**
737
772
  * an ethereum address represented as 40 hex digits
738
773
  * @pattern ^0x[a-fA-F0-9]{40}$
739
774
  */
740
775
  type ETH_ADDRESS = string;
776
+ /**
777
+ * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.
778
+ * @pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$
779
+ */
780
+ type STORAGE_KEY = string;
781
+ type ADDRESS = FELT;
782
+ type NUM_AS_HEX = string;
783
+ type SIGNATURE = Array<FELT>;
741
784
  type BLOCK_NUMBER = number;
742
785
  type BLOCK_HASH = FELT;
743
786
  type TXN_HASH = FELT;
744
- declare enum TXN_TYPE {
745
- DECLARE = "DECLARE",
746
- DEPLOY = "DEPLOY",
747
- DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT",
748
- INVOKE = "INVOKE",
749
- L1_HANDLER = "L1_HANDLER"
750
- }
787
+ type CHAIN_ID = NUM_AS_HEX;
788
+ type STRUCT_ABI_TYPE = 'struct';
789
+ type EVENT_ABI_TYPE = 'event';
790
+ type FUNCTION_ABI_TYPE = 'function' | 'l1_handler' | 'constructor';
791
+ type ENTRY_POINT_TYPE = 'EXTERNAL' | 'L1_HANDLER' | 'CONSTRUCTOR';
792
+ type CALL_TYPE = 'DELEGATE' | 'LIBRARY_CALL' | 'CALL';
793
+ type TXN_STATUS = 'RECEIVED' | 'REJECTED' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1';
794
+ type SIMULATION_FLAG$1 = 'SKIP_VALIDATE' | 'SKIP_FEE_CHARGE';
795
+ type DA_MODE = 'L1' | 'L2';
796
+ type TXN_TYPE = 'DECLARE' | 'DEPLOY' | 'DEPLOY_ACCOUNT' | 'INVOKE' | 'L1_HANDLER';
797
+ type TXN_FINALITY_STATUS = 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1';
798
+ type TXN_EXECUTION_STATUS = 'SUCCEEDED' | 'REVERTED';
751
799
  type BLOCK_STATUS = 'PENDING' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED';
752
- declare enum BLOCK_TAG {
753
- latest = "latest",
754
- pending = "pending"
755
- }
756
- type BLOCK_ID = {
800
+ type BLOCK_TAG = 'latest' | 'pending';
801
+ /**
802
+ * READ API
803
+ */
804
+ type EVENTS_CHUNK = {
805
+ events: EMITTED_EVENT[];
806
+ continuation_token?: string;
807
+ };
808
+ type RESULT_PAGE_REQUEST = {
809
+ continuation_token?: string;
810
+ chunk_size: number;
811
+ };
812
+ type EMITTED_EVENT = EVENT$1 & {
757
813
  block_hash: BLOCK_HASH;
758
- } | {
759
814
  block_number: BLOCK_NUMBER;
760
- } | BLOCK_TAG;
761
- type MSG_TO_L1 = {
762
- to_address: FELT;
763
- payload: Array<FELT>;
815
+ transaction_hash: TXN_HASH;
764
816
  };
765
- type MSG_FROM_L1 = {
766
- from_address: ETH_ADDRESS;
767
- to_address: ADDRESS;
768
- entry_point_selector: FELT;
769
- payload: FELT[];
817
+ type EVENT$1 = {
818
+ from_address: ADDRESS;
819
+ } & EVENT_CONTENT;
820
+ type EVENT_CONTENT = {
821
+ keys: FELT[];
822
+ data: FELT[];
770
823
  };
771
- declare enum TXN_FINALITY_STATUS {
772
- ACCEPTED_ON_L2 = "ACCEPTED_ON_L2",
773
- ACCEPTED_ON_L1 = "ACCEPTED_ON_L1"
774
- }
775
- declare enum TXN_EXECUTION_STATUS {
776
- SUCCEEDED = "SUCCEEDED",
777
- REVERTED = "REVERTED"
778
- }
779
- type EVENT = {
780
- from_address: FELT;
781
- keys: Array<FELT>;
782
- data: Array<FELT>;
824
+ type EVENT_FILTER = {
825
+ from_block?: BLOCK_ID;
826
+ to_block?: BLOCK_ID;
827
+ address?: ADDRESS;
828
+ keys?: FELT[][];
783
829
  };
784
- type COMMON_RECEIPT_PROPERTIES = {
785
- transaction_hash: TXN_HASH;
786
- actual_fee: FELT;
787
- execution_status: TXN_EXECUTION_STATUS;
788
- finality_status: TXN_FINALITY_STATUS;
830
+ type BLOCK_ID = {
789
831
  block_hash?: BLOCK_HASH;
790
832
  block_number?: BLOCK_NUMBER;
791
- messages_sent: Array<MSG_TO_L1>;
792
- events: Array<EVENT>;
793
- revert_reason?: string;
833
+ } | BLOCK_TAG;
834
+ type SYNC_STATUS = {
835
+ starting_block_hash: BLOCK_HASH;
836
+ starting_block_num: BLOCK_NUMBER;
837
+ current_block_hash: BLOCK_HASH;
838
+ current_block_num: BLOCK_NUMBER;
839
+ highest_block_hash: BLOCK_HASH;
840
+ highest_block_num: BLOCK_NUMBER;
794
841
  };
795
- type PENDING_COMMON_RECEIPT_PROPERTIES = {
796
- transaction_hash: TXN_HASH;
797
- actual_fee: FELT;
798
- type?: TXN_TYPE;
799
- messages_sent: Array<MSG_TO_L1>;
800
- events: Array<EVENT>;
801
- execution_status: TXN_EXECUTION_STATUS;
802
- finality_status: TXN_FINALITY_STATUS;
803
- revert_reason?: string;
842
+ type NEW_CLASSES = {
843
+ class_hash: FELT;
844
+ compiled_class_hash: FELT;
804
845
  };
805
- type INVOKE_TXN_RECEIPT = {
806
- type: 'INVOKE';
807
- } & COMMON_RECEIPT_PROPERTIES;
808
- type DECLARE_TXN_RECEIPT = {
809
- type: 'DECLARE';
810
- } & COMMON_RECEIPT_PROPERTIES;
811
- type DEPLOY_TXN_RECEIPT = {
812
- type: 'DEPLOY';
813
- contract_address: FELT;
814
- } & COMMON_RECEIPT_PROPERTIES;
815
- type L1_HANDLER_TXN_RECEIPT = {
816
- type: 'L1_HANDLER';
817
- } & COMMON_RECEIPT_PROPERTIES;
818
- type PENDING_DEPLOY_TXN_RECEIPT = {
846
+ type REPLACED_CLASS = {
847
+ class_hash: FELT;
819
848
  contract_address: FELT;
820
- } & PENDING_COMMON_RECEIPT_PROPERTIES;
821
- type PENDING_TXN_RECEIPT = PENDING_DEPLOY_TXN_RECEIPT | PENDING_COMMON_RECEIPT_PROPERTIES;
822
- type TXN_RECEIPT = INVOKE_TXN_RECEIPT | L1_HANDLER_TXN_RECEIPT | DECLARE_TXN_RECEIPT | DEPLOY_TXN_RECEIPT | DEPLOY_ACCOUNT_TXN_RECEIPT | PENDING_TXN_RECEIPT;
849
+ };
850
+ type NONCE_UPDATE = {
851
+ contract_address: ADDRESS;
852
+ nonce: FELT;
853
+ };
854
+ type STATE_DIFF = {
855
+ storage_diffs: CONTRACT_STORAGE_DIFF_ITEM[];
856
+ deprecated_declared_classes: FELT[];
857
+ declared_classes: NEW_CLASSES[];
858
+ deployed_contracts: DEPLOYED_CONTRACT_ITEM[];
859
+ replaced_classes: REPLACED_CLASS[];
860
+ nonces: NONCE_UPDATE[];
861
+ };
862
+ type PENDING_STATE_UPDATE = {
863
+ old_root: FELT;
864
+ state_diff: STATE_DIFF;
865
+ };
866
+ type STATE_UPDATE = {
867
+ block_hash: BLOCK_HASH;
868
+ old_root: FELT;
869
+ new_root: FELT;
870
+ state_diff: STATE_DIFF;
871
+ };
872
+ type BLOCK_BODY_WITH_TX_HASHES = {
873
+ transactions: TXN_HASH[];
874
+ };
875
+ type BLOCK_BODY_WITH_TXS = {
876
+ transactions: {
877
+ transaction: TXN;
878
+ transaction_hash: TXN_HASH;
879
+ }[];
880
+ };
823
881
  type BLOCK_HEADER = {
824
882
  block_hash: BLOCK_HASH;
825
883
  parent_hash: BLOCK_HASH;
@@ -827,25 +885,46 @@ type BLOCK_HEADER = {
827
885
  new_root: FELT;
828
886
  timestamp: number;
829
887
  sequencer_address: FELT;
888
+ l1_gas_price: RESOURCE_PRICE;
889
+ starknet_version: string;
830
890
  };
831
- type BLOCK_BODY_WITH_TX_HASHES = {
832
- transactions: Array<TXN_HASH>;
891
+ type PENDING_BLOCK_HEADER = {
892
+ parent_hash: BLOCK_HASH;
893
+ timestamp: number;
894
+ sequencer_address: FELT;
895
+ l1_gas_price: RESOURCE_PRICE;
896
+ starknet_version: string;
833
897
  };
834
898
  type BLOCK_WITH_TX_HASHES = {
835
899
  status: BLOCK_STATUS;
836
900
  } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES;
837
- type PENDING_BLOCK_WITH_TX_HASHES = BLOCK_BODY_WITH_TX_HASHES & {
838
- timestamp: number;
839
- sequencer_address: FELT;
840
- parent_hash: BLOCK_HASH;
901
+ type BLOCK_WITH_TXS = {
902
+ status: BLOCK_STATUS;
903
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS;
904
+ type PENDING_BLOCK_WITH_TX_HASHES = BLOCK_BODY_WITH_TX_HASHES & PENDING_BLOCK_HEADER;
905
+ type PENDING_BLOCK_WITH_TXS = BLOCK_BODY_WITH_TXS & PENDING_BLOCK_HEADER;
906
+ type DEPLOYED_CONTRACT_ITEM = {
907
+ address: FELT;
908
+ class_hash: FELT;
841
909
  };
842
- type FUNCTION_CALL = {
843
- contract_address: ADDRESS;
844
- entry_point_selector: FELT;
845
- calldata: Array<FELT>;
910
+ type CONTRACT_STORAGE_DIFF_ITEM = {
911
+ address: string;
912
+ storage_entries: StorageDiffItem[];
913
+ };
914
+ type StorageDiffItem = {
915
+ key: string;
916
+ value: string;
917
+ };
918
+ type TXN = INVOKE_TXN | L1_HANDLER_TXN | DECLARE_TXN | DEPLOY_TXN | DEPLOY_ACCOUNT_TXN;
919
+ type DECLARE_TXN = DECLARE_TXN_V0 | DECLARE_TXN_V1 | DECLARE_TXN_V2;
920
+ type DECLARE_TXN_V0 = {
921
+ type: 'DECLARE';
922
+ sender_address: ADDRESS;
923
+ max_fee: FELT;
924
+ version: '0x0';
925
+ signature: SIGNATURE;
926
+ class_hash: FELT;
846
927
  };
847
- type INVOKE_TXN = INVOKE_TXN_V0 | INVOKE_TXN_V1;
848
- type DECLARE_TXN = DECLARE_TXN_V1 | DECLARE_TXN_V2;
849
928
  type DECLARE_TXN_V1 = {
850
929
  type: 'DECLARE';
851
930
  sender_address: ADDRESS;
@@ -853,11 +932,8 @@ type DECLARE_TXN_V1 = {
853
932
  version: '0x1';
854
933
  signature: SIGNATURE;
855
934
  nonce: FELT;
856
- } & ({
857
- contract_class: DEPRECATED_CONTRACT_CLASS;
858
- } | {
859
935
  class_hash: FELT;
860
- });
936
+ };
861
937
  type DECLARE_TXN_V2 = {
862
938
  type: 'DECLARE';
863
939
  sender_address: ADDRESS;
@@ -866,12 +942,33 @@ type DECLARE_TXN_V2 = {
866
942
  version: '0x2';
867
943
  signature: SIGNATURE;
868
944
  nonce: FELT;
869
- } & ({
870
- contract_class: CONTRACT_CLASS;
871
- } | {
872
945
  class_hash: FELT;
873
- });
874
- type DEPLOY_ACCOUNT_TXN = {
946
+ };
947
+ type BROADCASTED_TXN = BROADCASTED_INVOKE_TXN | BROADCASTED_DECLARE_TXN | BROADCASTED_DEPLOY_ACCOUNT_TXN;
948
+ type BROADCASTED_INVOKE_TXN = INVOKE_TXN_V0 | INVOKE_TXN_V1;
949
+ type BROADCASTED_DEPLOY_ACCOUNT_TXN = DEPLOY_ACCOUNT_TXN;
950
+ type BROADCASTED_DECLARE_TXN = BROADCASTED_DECLARE_TXN_V1 | BROADCASTED_DECLARE_TXN_V2;
951
+ type BROADCASTED_DECLARE_TXN_V1 = {
952
+ type: 'DECLARE';
953
+ sender_address: ADDRESS;
954
+ max_fee: FELT;
955
+ version: NUM_AS_HEX;
956
+ signature: SIGNATURE;
957
+ nonce: FELT;
958
+ contract_class: DEPRECATED_CONTRACT_CLASS;
959
+ };
960
+ type BROADCASTED_DECLARE_TXN_V2 = {
961
+ type: 'DECLARE';
962
+ sender_address: ADDRESS;
963
+ compiled_class_hash: FELT;
964
+ max_fee: FELT;
965
+ version: NUM_AS_HEX;
966
+ signature: SIGNATURE;
967
+ nonce: FELT;
968
+ contract_class: CONTRACT_CLASS;
969
+ };
970
+ type DEPLOY_ACCOUNT_TXN = DEPLOY_ACCOUNT_TXN_V1;
971
+ type DEPLOY_ACCOUNT_TXN_V1 = {
875
972
  type: 'DEPLOY_ACCOUNT';
876
973
  max_fee: FELT;
877
974
  version: NUM_AS_HEX;
@@ -883,27 +980,12 @@ type DEPLOY_ACCOUNT_TXN = {
883
980
  };
884
981
  type DEPLOY_TXN = {
885
982
  type: 'DEPLOY';
983
+ version: NUM_AS_HEX;
886
984
  contract_address_salt: FELT;
887
985
  constructor_calldata: FELT[];
888
986
  class_hash: FELT;
889
- version: NUM_AS_HEX;
890
- };
891
- type DEPLOY_ACCOUNT_TXN_RECEIPT = COMMON_RECEIPT_PROPERTIES & {
892
- type: 'DEPLOY_ACCOUNT';
893
- contract_address: FELT;
894
987
  };
895
- type TXN = INVOKE_TXN | L1_HANDLER_TXN | DECLARE_TXN | DEPLOY_TXN | DEPLOY_ACCOUNT_TXN;
896
- type TXN_WITH_HASH = TXN & {
897
- transaction_hash: TXN_HASH;
898
- };
899
- declare enum L1_HANDLER {
900
- 'L1_HANDLER' = 0
901
- }
902
- type L1_HANDLER_TXN = {
903
- version: NUM_AS_HEX;
904
- type: L1_HANDLER;
905
- nonce: NUM_AS_HEX;
906
- } & FUNCTION_CALL;
988
+ type INVOKE_TXN = INVOKE_TXN_V0 | INVOKE_TXN_V1;
907
989
  type INVOKE_TXN_V0 = {
908
990
  type: 'INVOKE';
909
991
  max_fee: FELT;
@@ -918,722 +1000,1108 @@ type INVOKE_TXN_V1 = {
918
1000
  sender_address: ADDRESS;
919
1001
  calldata: FELT[];
920
1002
  max_fee: FELT;
921
- version: '0x1';
1003
+ version: NUM_AS_HEX;
922
1004
  signature: SIGNATURE;
923
1005
  nonce: FELT;
924
1006
  };
925
- type BLOCK_BODY_WITH_TXS = {
926
- transactions: Array<TXN_WITH_HASH>;
1007
+ type L1_HANDLER_TXN = {
1008
+ version: NUM_AS_HEX;
1009
+ type: 'L1_HANDLER';
1010
+ nonce: NUM_AS_HEX;
1011
+ } & FUNCTION_CALL;
1012
+ type COMMON_RECEIPT_PROPERTIES = {
1013
+ transaction_hash: TXN_HASH;
1014
+ actual_fee: FELT;
1015
+ execution_status: TXN_EXECUTION_STATUS;
1016
+ finality_status: TXN_FINALITY_STATUS;
1017
+ block_hash: BLOCK_HASH;
1018
+ block_number: BLOCK_NUMBER;
1019
+ messages_sent: MSG_TO_L1[];
1020
+ revert_reason: string;
1021
+ events: EVENT$1[];
1022
+ execution_resources: EXECUTION_RESOURCES;
927
1023
  };
928
- type BLOCK_WITH_TXS = {
929
- status: BLOCK_STATUS;
930
- } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS;
931
- type PENDING_BLOCK_WITH_TXS = BLOCK_BODY_WITH_TXS & {
932
- timestamp: number;
933
- sequencer_address: FELT;
934
- parent_hash: BLOCK_HASH;
1024
+ type PENDING_COMMON_RECEIPT_PROPERTIES = {
1025
+ transaction_hash: TXN_HASH;
1026
+ actual_fee: FELT;
1027
+ type: TXN_TYPE;
1028
+ messages_sent: MSG_TO_L1[];
1029
+ events: EVENT$1[];
1030
+ revert_reason: string;
1031
+ finality_status: 'ACCEPTED_ON_L2';
1032
+ execution_status: TXN_EXECUTION_STATUS;
1033
+ execution_resources: EXECUTION_RESOURCES;
1034
+ };
1035
+ type INVOKE_TXN_RECEIPT = {
1036
+ type: 'INVOKE';
1037
+ } & COMMON_RECEIPT_PROPERTIES;
1038
+ type PENDING_INVOKE_TXN_RECEIPT = {
1039
+ type: 'INVOKE';
1040
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
1041
+ type DECLARE_TXN_RECEIPT = {
1042
+ type: 'DECLARE';
1043
+ } & COMMON_RECEIPT_PROPERTIES;
1044
+ type PENDING_DECLARE_TXN_RECEIPT = {
1045
+ type: 'DECLARE';
1046
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
1047
+ type DEPLOY_ACCOUNT_TXN_RECEIPT = {
1048
+ type: 'DEPLOY_ACCOUNT';
1049
+ contract_address: FELT;
1050
+ } & COMMON_RECEIPT_PROPERTIES;
1051
+ type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT = {
1052
+ type: 'DEPLOY_ACCOUNT';
1053
+ contract_address: FELT;
1054
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
1055
+ type DEPLOY_TXN_RECEIPT = {
1056
+ type: 'DEPLOY';
1057
+ contract_address: FELT;
1058
+ } & COMMON_RECEIPT_PROPERTIES;
1059
+ type L1_HANDLER_TXN_RECEIPT = {
1060
+ type: 'L1_HANDLER';
1061
+ message_hash: NUM_AS_HEX;
1062
+ } & COMMON_RECEIPT_PROPERTIES;
1063
+ type PENDING_L1_HANDLER_TXN_RECEIPT = {
1064
+ type: 'L1_HANDLER';
1065
+ message_hash: NUM_AS_HEX;
1066
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
1067
+ type TXN_RECEIPT = INVOKE_TXN_RECEIPT | L1_HANDLER_TXN_RECEIPT | DECLARE_TXN_RECEIPT | DEPLOY_TXN_RECEIPT | DEPLOY_ACCOUNT_TXN_RECEIPT;
1068
+ type PENDING_TXN_RECEIPT = PENDING_INVOKE_TXN_RECEIPT | PENDING_L1_HANDLER_TXN_RECEIPT | PENDING_DECLARE_TXN_RECEIPT | PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT;
1069
+ type MSG_TO_L1 = {
1070
+ from_address: FELT;
1071
+ to_address: FELT;
1072
+ payload: FELT[];
1073
+ };
1074
+ type MSG_FROM_L1 = {
1075
+ from_address: ETH_ADDRESS;
1076
+ to_address: ADDRESS;
1077
+ entry_point_selector: FELT;
1078
+ payload: FELT[];
1079
+ };
1080
+ type FUNCTION_CALL = {
1081
+ contract_address: ADDRESS;
1082
+ entry_point_selector: FELT;
1083
+ calldata: FELT[];
935
1084
  };
936
1085
  type CONTRACT_CLASS = {
937
- sierra_program: Array<FELT>;
1086
+ sierra_program: FELT[];
938
1087
  contract_class_version: string;
939
1088
  entry_points_by_type: {
940
- CONSTRUCTOR: Array<SIERRA_ENTRY_POINT>;
941
- EXTERNAL: Array<SIERRA_ENTRY_POINT>;
942
- L1_HANDLER: Array<SIERRA_ENTRY_POINT>;
1089
+ CONSTRUCTOR: SIERRA_ENTRY_POINT[];
1090
+ EXTERNAL: SIERRA_ENTRY_POINT[];
1091
+ L1_HANDLER: SIERRA_ENTRY_POINT[];
943
1092
  };
944
- abi?: string;
1093
+ abi: string;
945
1094
  };
946
1095
  type DEPRECATED_CONTRACT_CLASS = {
947
1096
  program: string;
948
1097
  entry_points_by_type: {
949
- CONSTRUCTOR: Array<DEPRECATED_CAIRO_ENTRY_POINT>;
950
- EXTERNAL: Array<DEPRECATED_CAIRO_ENTRY_POINT>;
951
- L1_HANDLER: Array<DEPRECATED_CAIRO_ENTRY_POINT>;
1098
+ CONSTRUCTOR: DEPRECATED_CAIRO_ENTRY_POINT[];
1099
+ EXTERNAL: DEPRECATED_CAIRO_ENTRY_POINT[];
1100
+ L1_HANDLER: DEPRECATED_CAIRO_ENTRY_POINT[];
952
1101
  };
953
- abi?: CONTRACT_ABI;
954
- };
955
- type CONTRACT_ABI = Array<CONTRACT_ABI_ENTRY>;
956
- type CONTRACT_ABI_ENTRY = FUNCTION_ABI_ENTRY | EVENT_ABI_ENTRY | STRUCT_ABI_ENTRY;
957
- declare enum STRUCT_ABI_TYPE {
958
- 'struct' = 0
959
- }
960
- declare enum EVENT_ABI_TYPE {
961
- 'event' = 0
962
- }
963
- declare enum FUNCTION_ABI_TYPE {
964
- 'function' = 0,
965
- 'l1_handler' = 1,
966
- 'constructor' = 2
967
- }
968
- type STRUCT_ABI_ENTRY = STRUCT_ABI_TYPE & {
969
- name: string;
970
- size: number;
971
- members: Array<STRUCT_MEMBER>;
972
- };
973
- type STRUCT_MEMBER = {
974
- offset: number;
975
- } & TYPED_PARAMETER;
976
- type EVENT_ABI_ENTRY = {
977
- name: string;
978
- keys: Array<TYPED_PARAMETER>;
979
- data: Array<TYPED_PARAMETER>;
980
- } & EVENT_ABI_TYPE;
981
- type FUNCTION_ABI_ENTRY = {
982
- type: FUNCTION_ABI_TYPE;
983
- name: string;
984
- inputs: Array<TYPED_PARAMETER>;
985
- outputs: Array<TYPED_PARAMETER>;
986
- };
987
- type TYPED_PARAMETER = {
988
- name: string;
989
- type: string;
1102
+ abi: CONTRACT_ABI;
990
1103
  };
991
1104
  type DEPRECATED_CAIRO_ENTRY_POINT = {
992
- offset: NUM_AS_HEX;
1105
+ offset: NUM_AS_HEX | number;
993
1106
  selector: FELT;
994
1107
  };
995
1108
  type SIERRA_ENTRY_POINT = {
996
1109
  selector: FELT;
997
1110
  function_idx: number;
998
1111
  };
999
- type CONTRACT_STORAGE_DIFF_ITEM = {
1000
- address: FELT;
1001
- storage_entries: {
1002
- key: FELT;
1003
- value: FELT;
1004
- }[];
1005
- };
1006
- type DEPLOYED_CONTRACT_ITEM = {
1007
- address: FELT;
1008
- class_hash: FELT;
1009
- };
1010
- type STATE_UPDATE = {
1011
- block_hash: BLOCK_HASH;
1012
- new_root: FELT;
1013
- } & PENDING_STATE_UPDATE;
1014
- type PENDING_STATE_UPDATE = {
1015
- old_root: FELT;
1016
- state_diff: {
1017
- storage_diffs: Array<CONTRACT_STORAGE_DIFF_ITEM>;
1018
- deprecated_declared_classes: Array<FELT>;
1019
- declared_classes: Array<{
1020
- class_hash: FELT;
1021
- compiled_class_hash: FELT;
1022
- }>;
1023
- deployed_contracts: Array<DEPLOYED_CONTRACT_ITEM>;
1024
- replaced_classes: Array<{
1025
- contract_address: ADDRESS;
1026
- class_hash: FELT;
1027
- }>;
1028
- nonces: Array<{
1029
- contract_address: ADDRESS;
1030
- nonce: FELT;
1031
- }>;
1032
- };
1033
- };
1034
- /**
1035
- * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.
1036
- * @pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$
1037
- */
1038
- type STORAGE_KEY = string;
1039
- type EVENT_FILTER = {
1040
- from_block?: BLOCK_ID;
1041
- to_block?: BLOCK_ID;
1042
- address?: ADDRESS;
1043
- keys?: Array<Array<FELT>>;
1112
+ type CONTRACT_ABI = CONTRACT_ABI_ENTRY[];
1113
+ type CONTRACT_ABI_ENTRY = {
1114
+ selector: FELT;
1115
+ input: string;
1116
+ output: string;
1044
1117
  };
1045
- type EVENTS_CHUNK = {
1046
- events: Array<EMITTED_EVENT>;
1047
- continuation_token?: string;
1118
+ type STRUCT_ABI_ENTRY = {
1119
+ type: STRUCT_ABI_TYPE;
1120
+ name: string;
1121
+ size: number;
1122
+ members: STRUCT_MEMBER[];
1048
1123
  };
1049
- type RESULT_PAGE_REQUEST = {
1050
- continuation_token?: string;
1051
- chunk_size: number;
1124
+ type STRUCT_MEMBER = TYPED_PARAMETER & {
1125
+ offset: number;
1052
1126
  };
1053
- type EMITTED_EVENT = EVENT & {
1054
- block_hash: BLOCK_HASH;
1055
- block_number: BLOCK_NUMBER;
1056
- transaction_hash: TXN_HASH;
1127
+ type EVENT_ABI_ENTRY = {
1128
+ type: EVENT_ABI_TYPE;
1129
+ name: string;
1130
+ keys: TYPED_PARAMETER[];
1131
+ data: TYPED_PARAMETER[];
1057
1132
  };
1058
- type SYNC_STATUS = {
1059
- starting_block_hash: BLOCK_HASH;
1060
- starting_block_num: BLOCK_NUMBER;
1061
- current_block_hash: BLOCK_HASH;
1062
- current_block_num: BLOCK_NUMBER;
1063
- highest_block_hash: BLOCK_HASH;
1064
- highest_block_num: BLOCK_NUMBER;
1133
+ type FUNCTION_STATE_MUTABILITY = 'view';
1134
+ type FUNCTION_ABI_ENTRY = {
1135
+ type: FUNCTION_ABI_TYPE;
1136
+ name: string;
1137
+ inputs: TYPED_PARAMETER[];
1138
+ outputs: TYPED_PARAMETER[];
1139
+ stateMutability: FUNCTION_STATE_MUTABILITY;
1140
+ };
1141
+ type TYPED_PARAMETER = {
1142
+ name: string;
1143
+ type: string;
1065
1144
  };
1066
1145
  type FEE_ESTIMATE = {
1067
1146
  gas_consumed: NUM_AS_HEX;
1068
1147
  gas_price: NUM_AS_HEX;
1069
1148
  overall_fee: NUM_AS_HEX;
1070
1149
  };
1071
- declare enum CALL_TYPE {
1072
- 'LIBRARY_CALL' = 0,
1073
- 'CALL' = 1
1074
- }
1075
- declare enum ENTRY_POINT_TYPE {
1076
- 'EXTERNAL' = 0,
1077
- 'L1_HANDLER' = 1,
1078
- 'CONSTRUCTOR' = 2
1079
- }
1080
- type FUNCTION_INVOCATION = FUNCTION_CALL & {
1081
- caller_address: FELT;
1082
- class_hash: FELT;
1083
- entry_point_type: ENTRY_POINT_TYPE;
1084
- call_type: CALL_TYPE;
1085
- result: FELT;
1086
- calls: NESTED_CALL;
1087
- events: Array<EVENT>;
1088
- messages: MSG_TO_L1;
1150
+ type RESOURCE_LIMITS = {
1151
+ max_amount: NUM_AS_HEX;
1152
+ max_price_per_unit: NUM_AS_HEX;
1153
+ };
1154
+ type RESOURCE_PRICE = {
1155
+ price_in_strk?: NUM_AS_HEX;
1156
+ price_in_wei: NUM_AS_HEX;
1157
+ };
1158
+ type EXECUTION_RESOURCES = {
1159
+ steps: NUM_AS_HEX;
1160
+ memory_holes: NUM_AS_HEX;
1161
+ range_check_builtin_applications: NUM_AS_HEX;
1162
+ pedersen_builtin_applications: NUM_AS_HEX;
1163
+ poseidon_builtin_applications: NUM_AS_HEX;
1164
+ ec_op_builtin_applications: NUM_AS_HEX;
1165
+ ecdsa_builtin_applications: NUM_AS_HEX;
1166
+ bitwise_builtin_applications: NUM_AS_HEX;
1167
+ keccak_builtin_applications: NUM_AS_HEX;
1168
+ };
1169
+ /**
1170
+ * TRACE API
1171
+ */
1172
+ type TRANSACTION_TRACE = {
1173
+ invoke_tx_trace?: INVOKE_TXN_TRACE;
1174
+ declare_tx_trace?: DECLARE_TXN_TRACE;
1175
+ deploy_account_tx_trace?: DEPLOY_ACCOUNT_TXN_TRACE;
1176
+ l1_handler_tx_trace?: L1_HANDLER_TXN_TRACE;
1089
1177
  };
1090
- type NESTED_CALL = FUNCTION_INVOCATION;
1091
1178
  type INVOKE_TXN_TRACE = {
1092
- validate_invocation: FUNCTION_INVOCATION;
1179
+ type: 'INVOKE';
1093
1180
  execute_invocation: FUNCTION_INVOCATION | {
1094
1181
  revert_reason: string;
1095
1182
  };
1096
- fee_transfer_invocation: FUNCTION_INVOCATION;
1183
+ validate_invocation?: FUNCTION_INVOCATION;
1184
+ fee_transfer_invocation?: FUNCTION_INVOCATION;
1185
+ state_diff?: STATE_DIFF;
1097
1186
  };
1098
1187
  type DECLARE_TXN_TRACE = {
1099
- validate_invocation: FUNCTION_INVOCATION;
1100
- fee_transfer_invocation: FUNCTION_INVOCATION;
1188
+ type: 'DECLARE';
1189
+ validate_invocation?: FUNCTION_INVOCATION;
1190
+ fee_transfer_invocation?: FUNCTION_INVOCATION;
1191
+ state_diff?: STATE_DIFF;
1101
1192
  };
1102
1193
  type DEPLOY_ACCOUNT_TXN_TRACE = {
1103
- validate_invocation: FUNCTION_INVOCATION;
1194
+ type: 'DEPLOY_ACCOUNT';
1104
1195
  constructor_invocation: FUNCTION_INVOCATION;
1105
- fee_transfer_invocation: FUNCTION_INVOCATION;
1196
+ validate_invocation?: FUNCTION_INVOCATION;
1197
+ fee_transfer_invocation?: FUNCTION_INVOCATION;
1198
+ state_diff?: STATE_DIFF;
1106
1199
  };
1107
1200
  type L1_HANDLER_TXN_TRACE = {
1201
+ type: 'L1_HANDLER';
1108
1202
  function_invocation: FUNCTION_INVOCATION;
1203
+ state_diff?: STATE_DIFF;
1109
1204
  };
1110
- type TRANSACTION_TRACE = INVOKE_TXN_TRACE | DECLARE_TXN_TRACE | DEPLOY_ACCOUNT_TXN_TRACE | L1_HANDLER_TXN_TRACE;
1111
- declare enum SIMULATION_FLAG$1 {
1112
- SKIP_VALIDATE = "SKIP_VALIDATE",
1113
- SKIP_FEE_CHARGE = "SKIP_FEE_CHARGE"
1205
+ type NESTED_CALL = FUNCTION_INVOCATION;
1206
+ type FUNCTION_INVOCATION = {
1207
+ function_call: FUNCTION_CALL;
1208
+ caller_address: string;
1209
+ class_hash: string;
1210
+ entry_point_type: ENTRY_POINT_TYPE;
1211
+ call_type: CALL_TYPE;
1212
+ result: string[];
1213
+ calls: NESTED_CALL[];
1214
+ events: ORDERED_EVENT[];
1215
+ messages: ORDERED_MESSAGE[];
1216
+ };
1217
+ type ORDERED_EVENT = {
1218
+ order: number;
1219
+ event: EVENT$1;
1220
+ };
1221
+ type ORDERED_MESSAGE = {
1222
+ order: number;
1223
+ message: MSG_TO_L1;
1224
+ };
1225
+
1226
+ type components_ADDRESS = ADDRESS;
1227
+ type components_BLOCK_BODY_WITH_TXS = BLOCK_BODY_WITH_TXS;
1228
+ type components_BLOCK_BODY_WITH_TX_HASHES = BLOCK_BODY_WITH_TX_HASHES;
1229
+ type components_BLOCK_HASH = BLOCK_HASH;
1230
+ type components_BLOCK_HEADER = BLOCK_HEADER;
1231
+ type components_BLOCK_ID = BLOCK_ID;
1232
+ type components_BLOCK_NUMBER = BLOCK_NUMBER;
1233
+ type components_BLOCK_STATUS = BLOCK_STATUS;
1234
+ type components_BLOCK_TAG = BLOCK_TAG;
1235
+ type components_BLOCK_WITH_TXS = BLOCK_WITH_TXS;
1236
+ type components_BLOCK_WITH_TX_HASHES = BLOCK_WITH_TX_HASHES;
1237
+ type components_BROADCASTED_DECLARE_TXN = BROADCASTED_DECLARE_TXN;
1238
+ type components_BROADCASTED_DECLARE_TXN_V1 = BROADCASTED_DECLARE_TXN_V1;
1239
+ type components_BROADCASTED_DECLARE_TXN_V2 = BROADCASTED_DECLARE_TXN_V2;
1240
+ type components_BROADCASTED_DEPLOY_ACCOUNT_TXN = BROADCASTED_DEPLOY_ACCOUNT_TXN;
1241
+ type components_BROADCASTED_INVOKE_TXN = BROADCASTED_INVOKE_TXN;
1242
+ type components_BROADCASTED_TXN = BROADCASTED_TXN;
1243
+ type components_CALL_TYPE = CALL_TYPE;
1244
+ type components_CHAIN_ID = CHAIN_ID;
1245
+ type components_COMMON_RECEIPT_PROPERTIES = COMMON_RECEIPT_PROPERTIES;
1246
+ type components_CONTRACT_ABI = CONTRACT_ABI;
1247
+ type components_CONTRACT_ABI_ENTRY = CONTRACT_ABI_ENTRY;
1248
+ type components_CONTRACT_CLASS = CONTRACT_CLASS;
1249
+ type components_CONTRACT_STORAGE_DIFF_ITEM = CONTRACT_STORAGE_DIFF_ITEM;
1250
+ type components_DA_MODE = DA_MODE;
1251
+ type components_DECLARE_TXN = DECLARE_TXN;
1252
+ type components_DECLARE_TXN_RECEIPT = DECLARE_TXN_RECEIPT;
1253
+ type components_DECLARE_TXN_TRACE = DECLARE_TXN_TRACE;
1254
+ type components_DECLARE_TXN_V0 = DECLARE_TXN_V0;
1255
+ type components_DECLARE_TXN_V1 = DECLARE_TXN_V1;
1256
+ type components_DECLARE_TXN_V2 = DECLARE_TXN_V2;
1257
+ type components_DEPLOYED_CONTRACT_ITEM = DEPLOYED_CONTRACT_ITEM;
1258
+ type components_DEPLOY_ACCOUNT_TXN = DEPLOY_ACCOUNT_TXN;
1259
+ type components_DEPLOY_ACCOUNT_TXN_RECEIPT = DEPLOY_ACCOUNT_TXN_RECEIPT;
1260
+ type components_DEPLOY_ACCOUNT_TXN_TRACE = DEPLOY_ACCOUNT_TXN_TRACE;
1261
+ type components_DEPLOY_ACCOUNT_TXN_V1 = DEPLOY_ACCOUNT_TXN_V1;
1262
+ type components_DEPLOY_TXN = DEPLOY_TXN;
1263
+ type components_DEPLOY_TXN_RECEIPT = DEPLOY_TXN_RECEIPT;
1264
+ type components_DEPRECATED_CAIRO_ENTRY_POINT = DEPRECATED_CAIRO_ENTRY_POINT;
1265
+ type components_DEPRECATED_CONTRACT_CLASS = DEPRECATED_CONTRACT_CLASS;
1266
+ type components_EMITTED_EVENT = EMITTED_EVENT;
1267
+ type components_ENTRY_POINT_TYPE = ENTRY_POINT_TYPE;
1268
+ type components_ETH_ADDRESS = ETH_ADDRESS;
1269
+ type components_EVENTS_CHUNK = EVENTS_CHUNK;
1270
+ type components_EVENT_ABI_ENTRY = EVENT_ABI_ENTRY;
1271
+ type components_EVENT_ABI_TYPE = EVENT_ABI_TYPE;
1272
+ type components_EVENT_CONTENT = EVENT_CONTENT;
1273
+ type components_EVENT_FILTER = EVENT_FILTER;
1274
+ type components_EXECUTION_RESOURCES = EXECUTION_RESOURCES;
1275
+ type components_FEE_ESTIMATE = FEE_ESTIMATE;
1276
+ type components_FELT = FELT;
1277
+ type components_FUNCTION_ABI_ENTRY = FUNCTION_ABI_ENTRY;
1278
+ type components_FUNCTION_ABI_TYPE = FUNCTION_ABI_TYPE;
1279
+ type components_FUNCTION_CALL = FUNCTION_CALL;
1280
+ type components_FUNCTION_INVOCATION = FUNCTION_INVOCATION;
1281
+ type components_FUNCTION_STATE_MUTABILITY = FUNCTION_STATE_MUTABILITY;
1282
+ type components_INVOKE_TXN = INVOKE_TXN;
1283
+ type components_INVOKE_TXN_RECEIPT = INVOKE_TXN_RECEIPT;
1284
+ type components_INVOKE_TXN_TRACE = INVOKE_TXN_TRACE;
1285
+ type components_INVOKE_TXN_V0 = INVOKE_TXN_V0;
1286
+ type components_INVOKE_TXN_V1 = INVOKE_TXN_V1;
1287
+ type components_L1_HANDLER_TXN = L1_HANDLER_TXN;
1288
+ type components_L1_HANDLER_TXN_RECEIPT = L1_HANDLER_TXN_RECEIPT;
1289
+ type components_L1_HANDLER_TXN_TRACE = L1_HANDLER_TXN_TRACE;
1290
+ type components_MSG_FROM_L1 = MSG_FROM_L1;
1291
+ type components_MSG_TO_L1 = MSG_TO_L1;
1292
+ type components_NESTED_CALL = NESTED_CALL;
1293
+ type components_NEW_CLASSES = NEW_CLASSES;
1294
+ type components_NONCE_UPDATE = NONCE_UPDATE;
1295
+ type components_NUM_AS_HEX = NUM_AS_HEX;
1296
+ type components_ORDERED_EVENT = ORDERED_EVENT;
1297
+ type components_ORDERED_MESSAGE = ORDERED_MESSAGE;
1298
+ type components_PENDING_BLOCK_HEADER = PENDING_BLOCK_HEADER;
1299
+ type components_PENDING_BLOCK_WITH_TXS = PENDING_BLOCK_WITH_TXS;
1300
+ type components_PENDING_BLOCK_WITH_TX_HASHES = PENDING_BLOCK_WITH_TX_HASHES;
1301
+ type components_PENDING_COMMON_RECEIPT_PROPERTIES = PENDING_COMMON_RECEIPT_PROPERTIES;
1302
+ type components_PENDING_DECLARE_TXN_RECEIPT = PENDING_DECLARE_TXN_RECEIPT;
1303
+ type components_PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT = PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT;
1304
+ type components_PENDING_INVOKE_TXN_RECEIPT = PENDING_INVOKE_TXN_RECEIPT;
1305
+ type components_PENDING_L1_HANDLER_TXN_RECEIPT = PENDING_L1_HANDLER_TXN_RECEIPT;
1306
+ type components_PENDING_STATE_UPDATE = PENDING_STATE_UPDATE;
1307
+ type components_PENDING_TXN_RECEIPT = PENDING_TXN_RECEIPT;
1308
+ type components_REPLACED_CLASS = REPLACED_CLASS;
1309
+ type components_RESOURCE_LIMITS = RESOURCE_LIMITS;
1310
+ type components_RESOURCE_PRICE = RESOURCE_PRICE;
1311
+ type components_RESULT_PAGE_REQUEST = RESULT_PAGE_REQUEST;
1312
+ type components_SIERRA_ENTRY_POINT = SIERRA_ENTRY_POINT;
1313
+ type components_SIGNATURE = SIGNATURE;
1314
+ type components_STATE_DIFF = STATE_DIFF;
1315
+ type components_STATE_UPDATE = STATE_UPDATE;
1316
+ type components_STORAGE_KEY = STORAGE_KEY;
1317
+ type components_STRUCT_ABI_ENTRY = STRUCT_ABI_ENTRY;
1318
+ type components_STRUCT_ABI_TYPE = STRUCT_ABI_TYPE;
1319
+ type components_STRUCT_MEMBER = STRUCT_MEMBER;
1320
+ type components_SYNC_STATUS = SYNC_STATUS;
1321
+ type components_StorageDiffItem = StorageDiffItem;
1322
+ type components_TRANSACTION_TRACE = TRANSACTION_TRACE;
1323
+ type components_TXN = TXN;
1324
+ type components_TXN_EXECUTION_STATUS = TXN_EXECUTION_STATUS;
1325
+ type components_TXN_FINALITY_STATUS = TXN_FINALITY_STATUS;
1326
+ type components_TXN_HASH = TXN_HASH;
1327
+ type components_TXN_RECEIPT = TXN_RECEIPT;
1328
+ type components_TXN_STATUS = TXN_STATUS;
1329
+ type components_TXN_TYPE = TXN_TYPE;
1330
+ type components_TYPED_PARAMETER = TYPED_PARAMETER;
1331
+ declare namespace components {
1332
+ export {
1333
+ components_ADDRESS as ADDRESS,
1334
+ components_BLOCK_BODY_WITH_TXS as BLOCK_BODY_WITH_TXS,
1335
+ components_BLOCK_BODY_WITH_TX_HASHES as BLOCK_BODY_WITH_TX_HASHES,
1336
+ components_BLOCK_HASH as BLOCK_HASH,
1337
+ components_BLOCK_HEADER as BLOCK_HEADER,
1338
+ components_BLOCK_ID as BLOCK_ID,
1339
+ components_BLOCK_NUMBER as BLOCK_NUMBER,
1340
+ components_BLOCK_STATUS as BLOCK_STATUS,
1341
+ components_BLOCK_TAG as BLOCK_TAG,
1342
+ components_BLOCK_WITH_TXS as BLOCK_WITH_TXS,
1343
+ components_BLOCK_WITH_TX_HASHES as BLOCK_WITH_TX_HASHES,
1344
+ components_BROADCASTED_DECLARE_TXN as BROADCASTED_DECLARE_TXN,
1345
+ components_BROADCASTED_DECLARE_TXN_V1 as BROADCASTED_DECLARE_TXN_V1,
1346
+ components_BROADCASTED_DECLARE_TXN_V2 as BROADCASTED_DECLARE_TXN_V2,
1347
+ components_BROADCASTED_DEPLOY_ACCOUNT_TXN as BROADCASTED_DEPLOY_ACCOUNT_TXN,
1348
+ components_BROADCASTED_INVOKE_TXN as BROADCASTED_INVOKE_TXN,
1349
+ components_BROADCASTED_TXN as BROADCASTED_TXN,
1350
+ components_CALL_TYPE as CALL_TYPE,
1351
+ components_CHAIN_ID as CHAIN_ID,
1352
+ components_COMMON_RECEIPT_PROPERTIES as COMMON_RECEIPT_PROPERTIES,
1353
+ components_CONTRACT_ABI as CONTRACT_ABI,
1354
+ components_CONTRACT_ABI_ENTRY as CONTRACT_ABI_ENTRY,
1355
+ components_CONTRACT_CLASS as CONTRACT_CLASS,
1356
+ components_CONTRACT_STORAGE_DIFF_ITEM as CONTRACT_STORAGE_DIFF_ITEM,
1357
+ components_DA_MODE as DA_MODE,
1358
+ components_DECLARE_TXN as DECLARE_TXN,
1359
+ components_DECLARE_TXN_RECEIPT as DECLARE_TXN_RECEIPT,
1360
+ components_DECLARE_TXN_TRACE as DECLARE_TXN_TRACE,
1361
+ components_DECLARE_TXN_V0 as DECLARE_TXN_V0,
1362
+ components_DECLARE_TXN_V1 as DECLARE_TXN_V1,
1363
+ components_DECLARE_TXN_V2 as DECLARE_TXN_V2,
1364
+ components_DEPLOYED_CONTRACT_ITEM as DEPLOYED_CONTRACT_ITEM,
1365
+ components_DEPLOY_ACCOUNT_TXN as DEPLOY_ACCOUNT_TXN,
1366
+ components_DEPLOY_ACCOUNT_TXN_RECEIPT as DEPLOY_ACCOUNT_TXN_RECEIPT,
1367
+ components_DEPLOY_ACCOUNT_TXN_TRACE as DEPLOY_ACCOUNT_TXN_TRACE,
1368
+ components_DEPLOY_ACCOUNT_TXN_V1 as DEPLOY_ACCOUNT_TXN_V1,
1369
+ components_DEPLOY_TXN as DEPLOY_TXN,
1370
+ components_DEPLOY_TXN_RECEIPT as DEPLOY_TXN_RECEIPT,
1371
+ components_DEPRECATED_CAIRO_ENTRY_POINT as DEPRECATED_CAIRO_ENTRY_POINT,
1372
+ components_DEPRECATED_CONTRACT_CLASS as DEPRECATED_CONTRACT_CLASS,
1373
+ components_EMITTED_EVENT as EMITTED_EVENT,
1374
+ components_ENTRY_POINT_TYPE as ENTRY_POINT_TYPE,
1375
+ components_ETH_ADDRESS as ETH_ADDRESS,
1376
+ EVENT$1 as EVENT,
1377
+ components_EVENTS_CHUNK as EVENTS_CHUNK,
1378
+ components_EVENT_ABI_ENTRY as EVENT_ABI_ENTRY,
1379
+ components_EVENT_ABI_TYPE as EVENT_ABI_TYPE,
1380
+ components_EVENT_CONTENT as EVENT_CONTENT,
1381
+ components_EVENT_FILTER as EVENT_FILTER,
1382
+ components_EXECUTION_RESOURCES as EXECUTION_RESOURCES,
1383
+ components_FEE_ESTIMATE as FEE_ESTIMATE,
1384
+ components_FELT as FELT,
1385
+ components_FUNCTION_ABI_ENTRY as FUNCTION_ABI_ENTRY,
1386
+ components_FUNCTION_ABI_TYPE as FUNCTION_ABI_TYPE,
1387
+ components_FUNCTION_CALL as FUNCTION_CALL,
1388
+ components_FUNCTION_INVOCATION as FUNCTION_INVOCATION,
1389
+ components_FUNCTION_STATE_MUTABILITY as FUNCTION_STATE_MUTABILITY,
1390
+ components_INVOKE_TXN as INVOKE_TXN,
1391
+ components_INVOKE_TXN_RECEIPT as INVOKE_TXN_RECEIPT,
1392
+ components_INVOKE_TXN_TRACE as INVOKE_TXN_TRACE,
1393
+ components_INVOKE_TXN_V0 as INVOKE_TXN_V0,
1394
+ components_INVOKE_TXN_V1 as INVOKE_TXN_V1,
1395
+ components_L1_HANDLER_TXN as L1_HANDLER_TXN,
1396
+ components_L1_HANDLER_TXN_RECEIPT as L1_HANDLER_TXN_RECEIPT,
1397
+ components_L1_HANDLER_TXN_TRACE as L1_HANDLER_TXN_TRACE,
1398
+ components_MSG_FROM_L1 as MSG_FROM_L1,
1399
+ components_MSG_TO_L1 as MSG_TO_L1,
1400
+ components_NESTED_CALL as NESTED_CALL,
1401
+ components_NEW_CLASSES as NEW_CLASSES,
1402
+ components_NONCE_UPDATE as NONCE_UPDATE,
1403
+ components_NUM_AS_HEX as NUM_AS_HEX,
1404
+ components_ORDERED_EVENT as ORDERED_EVENT,
1405
+ components_ORDERED_MESSAGE as ORDERED_MESSAGE,
1406
+ components_PENDING_BLOCK_HEADER as PENDING_BLOCK_HEADER,
1407
+ components_PENDING_BLOCK_WITH_TXS as PENDING_BLOCK_WITH_TXS,
1408
+ components_PENDING_BLOCK_WITH_TX_HASHES as PENDING_BLOCK_WITH_TX_HASHES,
1409
+ components_PENDING_COMMON_RECEIPT_PROPERTIES as PENDING_COMMON_RECEIPT_PROPERTIES,
1410
+ components_PENDING_DECLARE_TXN_RECEIPT as PENDING_DECLARE_TXN_RECEIPT,
1411
+ components_PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT as PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT,
1412
+ components_PENDING_INVOKE_TXN_RECEIPT as PENDING_INVOKE_TXN_RECEIPT,
1413
+ components_PENDING_L1_HANDLER_TXN_RECEIPT as PENDING_L1_HANDLER_TXN_RECEIPT,
1414
+ components_PENDING_STATE_UPDATE as PENDING_STATE_UPDATE,
1415
+ components_PENDING_TXN_RECEIPT as PENDING_TXN_RECEIPT,
1416
+ components_REPLACED_CLASS as REPLACED_CLASS,
1417
+ components_RESOURCE_LIMITS as RESOURCE_LIMITS,
1418
+ components_RESOURCE_PRICE as RESOURCE_PRICE,
1419
+ components_RESULT_PAGE_REQUEST as RESULT_PAGE_REQUEST,
1420
+ components_SIERRA_ENTRY_POINT as SIERRA_ENTRY_POINT,
1421
+ components_SIGNATURE as SIGNATURE,
1422
+ SIMULATION_FLAG$1 as SIMULATION_FLAG,
1423
+ components_STATE_DIFF as STATE_DIFF,
1424
+ components_STATE_UPDATE as STATE_UPDATE,
1425
+ components_STORAGE_KEY as STORAGE_KEY,
1426
+ components_STRUCT_ABI_ENTRY as STRUCT_ABI_ENTRY,
1427
+ components_STRUCT_ABI_TYPE as STRUCT_ABI_TYPE,
1428
+ components_STRUCT_MEMBER as STRUCT_MEMBER,
1429
+ components_SYNC_STATUS as SYNC_STATUS,
1430
+ components_StorageDiffItem as StorageDiffItem,
1431
+ components_TRANSACTION_TRACE as TRANSACTION_TRACE,
1432
+ components_TXN as TXN,
1433
+ components_TXN_EXECUTION_STATUS as TXN_EXECUTION_STATUS,
1434
+ components_TXN_FINALITY_STATUS as TXN_FINALITY_STATUS,
1435
+ components_TXN_HASH as TXN_HASH,
1436
+ components_TXN_RECEIPT as TXN_RECEIPT,
1437
+ components_TXN_STATUS as TXN_STATUS,
1438
+ components_TXN_TYPE as TXN_TYPE,
1439
+ components_TYPED_PARAMETER as TYPED_PARAMETER,
1440
+ };
1114
1441
  }
1115
- declare namespace OPENRPC {
1116
- type Nonce = FELT;
1117
- type BlockWithTxHashes = BLOCK_WITH_TX_HASHES | PENDING_BLOCK_WITH_TX_HASHES;
1118
- type BlockWithTxs = BLOCK_WITH_TXS | PENDING_BLOCK_WITH_TXS;
1119
- type StateUpdate = STATE_UPDATE | PENDING_STATE_UPDATE;
1120
- type Storage = FELT;
1121
- type Transaction = TXN;
1122
- type TransactionWithHash = TXN_WITH_HASH;
1123
- type TransactionReceipt = TXN_RECEIPT;
1124
- type ContractClass = CONTRACT_CLASS;
1125
- type DeprecatedContractClass = DEPRECATED_CONTRACT_CLASS;
1126
- type CallResponse = Array<FELT>;
1127
- type EstimatedFee = FEE_ESTIMATE;
1128
- type BlockNumber = BLOCK_NUMBER;
1129
- type BlockHashAndNumber = {
1130
- block_hash: BLOCK_HASH;
1131
- block_number: BLOCK_NUMBER;
1132
- };
1133
- type CHAIN_ID = string;
1134
- type PendingTransactions = Array<TransactionWithHash>;
1135
- type SyncingStatus = false | SYNC_STATUS;
1136
- type Events = EVENTS_CHUNK;
1137
- type Trace = TRANSACTION_TRACE;
1138
- type Traces = Array<{
1139
- transaction_hash: FELT;
1140
- trace_root: TRANSACTION_TRACE;
1141
- }>;
1142
- type TransactionHash = TXN_HASH;
1143
- type BlockHash = BLOCK_HASH;
1144
- type EventFilter = EVENT_FILTER & RESULT_PAGE_REQUEST;
1145
- type InvokedTransaction = {
1146
- transaction_hash: TXN_HASH;
1147
- };
1148
- type DeclaredTransaction = {
1149
- transaction_hash: TXN_HASH;
1150
- class_hash: FELT;
1442
+
1443
+ interface FAILED_TO_RECEIVE_TXN {
1444
+ code: 1;
1445
+ message: 'Failed to write transaction';
1446
+ }
1447
+ interface NO_TRACE_AVAILABLE {
1448
+ code: 10;
1449
+ message: 'No trace available for transaction';
1450
+ data: {
1451
+ status: 'RECEIVED' | 'REJECTED';
1151
1452
  };
1152
- type DeployedTransaction = {
1153
- transaction_hash: TXN_HASH;
1154
- contract_address: FELT;
1453
+ }
1454
+ interface CONTRACT_NOT_FOUND {
1455
+ code: 20;
1456
+ message: 'Contract not found';
1457
+ }
1458
+ interface INVALID_MESSAGE_SELECTOR {
1459
+ code: 21;
1460
+ message: 'Invalid message selector';
1461
+ }
1462
+ interface INVALID_CALL_DATA {
1463
+ code: 22;
1464
+ message: 'Invalid call data';
1465
+ }
1466
+ interface BLOCK_NOT_FOUND {
1467
+ code: 24;
1468
+ message: 'Block not found';
1469
+ }
1470
+ interface INVALID_TXN_HASH {
1471
+ code: 25;
1472
+ message: 'Invalid transaction hash';
1473
+ }
1474
+ interface INVALID_BLOCK_HASH {
1475
+ code: 26;
1476
+ message: 'Invalid block hash';
1477
+ }
1478
+ interface INVALID_TXN_INDEX {
1479
+ code: 27;
1480
+ message: 'Invalid transaction index in a block';
1481
+ }
1482
+ interface CLASS_HASH_NOT_FOUND {
1483
+ code: 28;
1484
+ message: 'Class hash not found';
1485
+ }
1486
+ interface TXN_HASH_NOT_FOUND {
1487
+ code: 29;
1488
+ message: 'Transaction hash not found';
1489
+ }
1490
+ interface PAGE_SIZE_TOO_BIG {
1491
+ code: 31;
1492
+ message: 'Requested page size is too big';
1493
+ }
1494
+ interface NO_BLOCKS {
1495
+ code: 32;
1496
+ message: 'There are no blocks';
1497
+ }
1498
+ interface INVALID_CONTINUATION_TOKEN {
1499
+ code: 33;
1500
+ message: 'The supplied continuation token is invalid or unknown';
1501
+ }
1502
+ interface TOO_MANY_KEYS_IN_FILTER {
1503
+ code: 34;
1504
+ message: 'Too many keys provided in a filter';
1505
+ }
1506
+ interface CONTRACT_ERROR {
1507
+ code: 40;
1508
+ message: 'Contract error';
1509
+ data: {
1510
+ revert_error: string;
1155
1511
  };
1156
- type SimulationFlags = Array<SIMULATION_FLAG$1>;
1157
- type SimulatedTransaction = {
1158
- transaction_trace: Trace;
1159
- fee_estimation: EstimatedFee;
1512
+ }
1513
+ interface CLASS_ALREADY_DECLARED {
1514
+ code: 51;
1515
+ message: 'Class already declared';
1516
+ }
1517
+ interface INVALID_TRANSACTION_NONCE {
1518
+ code: 52;
1519
+ message: 'Invalid transaction nonce';
1520
+ }
1521
+ interface INSUFFICIENT_MAX_FEE {
1522
+ code: 53;
1523
+ message: 'Max fee is smaller than the minimal transaction cost (validation plus fee transfer)';
1524
+ }
1525
+ interface INSUFFICIENT_ACCOUNT_BALANCE {
1526
+ code: 54;
1527
+ message: "Account balance is smaller than the transaction's max_fee";
1528
+ }
1529
+ interface VALIDATION_FAILURE {
1530
+ code: 55;
1531
+ message: 'Account validation failed';
1532
+ }
1533
+ interface COMPILATION_FAILED {
1534
+ code: 56;
1535
+ message: 'Compilation failed';
1536
+ }
1537
+ interface CONTRACT_CLASS_SIZE_IS_TOO_LARGE {
1538
+ code: 57;
1539
+ message: 'Contract class size it too large';
1540
+ }
1541
+ interface NON_ACCOUNT {
1542
+ code: 58;
1543
+ message: 'Sender address in not an account contract';
1544
+ }
1545
+ interface DUPLICATE_TX {
1546
+ code: 59;
1547
+ message: 'A transaction with the same hash already exists in the mempool';
1548
+ }
1549
+ interface COMPILED_CLASS_HASH_MISMATCH {
1550
+ code: 60;
1551
+ message: 'the compiled class hash did not match the one supplied in the transaction';
1552
+ }
1553
+ interface UNSUPPORTED_TX_VERSION {
1554
+ code: 61;
1555
+ message: 'the transaction version is not supported';
1556
+ }
1557
+ interface UNSUPPORTED_CONTRACT_CLASS_VERSION {
1558
+ code: 62;
1559
+ message: 'the contract class version is not supported';
1560
+ }
1561
+ interface UNEXPECTED_ERROR {
1562
+ code: 63;
1563
+ message: 'An unexpected error occurred';
1564
+ data: string;
1565
+ }
1566
+
1567
+ type errors_BLOCK_NOT_FOUND = BLOCK_NOT_FOUND;
1568
+ type errors_CLASS_ALREADY_DECLARED = CLASS_ALREADY_DECLARED;
1569
+ type errors_CLASS_HASH_NOT_FOUND = CLASS_HASH_NOT_FOUND;
1570
+ type errors_COMPILATION_FAILED = COMPILATION_FAILED;
1571
+ type errors_COMPILED_CLASS_HASH_MISMATCH = COMPILED_CLASS_HASH_MISMATCH;
1572
+ type errors_CONTRACT_CLASS_SIZE_IS_TOO_LARGE = CONTRACT_CLASS_SIZE_IS_TOO_LARGE;
1573
+ type errors_CONTRACT_ERROR = CONTRACT_ERROR;
1574
+ type errors_CONTRACT_NOT_FOUND = CONTRACT_NOT_FOUND;
1575
+ type errors_DUPLICATE_TX = DUPLICATE_TX;
1576
+ type errors_FAILED_TO_RECEIVE_TXN = FAILED_TO_RECEIVE_TXN;
1577
+ type errors_INSUFFICIENT_ACCOUNT_BALANCE = INSUFFICIENT_ACCOUNT_BALANCE;
1578
+ type errors_INSUFFICIENT_MAX_FEE = INSUFFICIENT_MAX_FEE;
1579
+ type errors_INVALID_BLOCK_HASH = INVALID_BLOCK_HASH;
1580
+ type errors_INVALID_CALL_DATA = INVALID_CALL_DATA;
1581
+ type errors_INVALID_CONTINUATION_TOKEN = INVALID_CONTINUATION_TOKEN;
1582
+ type errors_INVALID_MESSAGE_SELECTOR = INVALID_MESSAGE_SELECTOR;
1583
+ type errors_INVALID_TRANSACTION_NONCE = INVALID_TRANSACTION_NONCE;
1584
+ type errors_INVALID_TXN_HASH = INVALID_TXN_HASH;
1585
+ type errors_INVALID_TXN_INDEX = INVALID_TXN_INDEX;
1586
+ type errors_NON_ACCOUNT = NON_ACCOUNT;
1587
+ type errors_NO_BLOCKS = NO_BLOCKS;
1588
+ type errors_NO_TRACE_AVAILABLE = NO_TRACE_AVAILABLE;
1589
+ type errors_PAGE_SIZE_TOO_BIG = PAGE_SIZE_TOO_BIG;
1590
+ type errors_TOO_MANY_KEYS_IN_FILTER = TOO_MANY_KEYS_IN_FILTER;
1591
+ type errors_TXN_HASH_NOT_FOUND = TXN_HASH_NOT_FOUND;
1592
+ type errors_UNEXPECTED_ERROR = UNEXPECTED_ERROR;
1593
+ type errors_UNSUPPORTED_CONTRACT_CLASS_VERSION = UNSUPPORTED_CONTRACT_CLASS_VERSION;
1594
+ type errors_UNSUPPORTED_TX_VERSION = UNSUPPORTED_TX_VERSION;
1595
+ type errors_VALIDATION_FAILURE = VALIDATION_FAILURE;
1596
+ declare namespace errors {
1597
+ export {
1598
+ errors_BLOCK_NOT_FOUND as BLOCK_NOT_FOUND,
1599
+ errors_CLASS_ALREADY_DECLARED as CLASS_ALREADY_DECLARED,
1600
+ errors_CLASS_HASH_NOT_FOUND as CLASS_HASH_NOT_FOUND,
1601
+ errors_COMPILATION_FAILED as COMPILATION_FAILED,
1602
+ errors_COMPILED_CLASS_HASH_MISMATCH as COMPILED_CLASS_HASH_MISMATCH,
1603
+ errors_CONTRACT_CLASS_SIZE_IS_TOO_LARGE as CONTRACT_CLASS_SIZE_IS_TOO_LARGE,
1604
+ errors_CONTRACT_ERROR as CONTRACT_ERROR,
1605
+ errors_CONTRACT_NOT_FOUND as CONTRACT_NOT_FOUND,
1606
+ errors_DUPLICATE_TX as DUPLICATE_TX,
1607
+ errors_FAILED_TO_RECEIVE_TXN as FAILED_TO_RECEIVE_TXN,
1608
+ errors_INSUFFICIENT_ACCOUNT_BALANCE as INSUFFICIENT_ACCOUNT_BALANCE,
1609
+ errors_INSUFFICIENT_MAX_FEE as INSUFFICIENT_MAX_FEE,
1610
+ errors_INVALID_BLOCK_HASH as INVALID_BLOCK_HASH,
1611
+ errors_INVALID_CALL_DATA as INVALID_CALL_DATA,
1612
+ errors_INVALID_CONTINUATION_TOKEN as INVALID_CONTINUATION_TOKEN,
1613
+ errors_INVALID_MESSAGE_SELECTOR as INVALID_MESSAGE_SELECTOR,
1614
+ errors_INVALID_TRANSACTION_NONCE as INVALID_TRANSACTION_NONCE,
1615
+ errors_INVALID_TXN_HASH as INVALID_TXN_HASH,
1616
+ errors_INVALID_TXN_INDEX as INVALID_TXN_INDEX,
1617
+ errors_NON_ACCOUNT as NON_ACCOUNT,
1618
+ errors_NO_BLOCKS as NO_BLOCKS,
1619
+ errors_NO_TRACE_AVAILABLE as NO_TRACE_AVAILABLE,
1620
+ errors_PAGE_SIZE_TOO_BIG as PAGE_SIZE_TOO_BIG,
1621
+ errors_TOO_MANY_KEYS_IN_FILTER as TOO_MANY_KEYS_IN_FILTER,
1622
+ errors_TXN_HASH_NOT_FOUND as TXN_HASH_NOT_FOUND,
1623
+ errors_UNEXPECTED_ERROR as UNEXPECTED_ERROR,
1624
+ errors_UNSUPPORTED_CONTRACT_CLASS_VERSION as UNSUPPORTED_CONTRACT_CLASS_VERSION,
1625
+ errors_UNSUPPORTED_TX_VERSION as UNSUPPORTED_TX_VERSION,
1626
+ errors_VALIDATION_FAILURE as VALIDATION_FAILURE,
1627
+ };
1628
+ }
1629
+
1630
+ /**
1631
+ * Types that are not in spec but required for UX
1632
+ */
1633
+
1634
+ type ContractClass = CONTRACT_CLASS | DEPRECATED_CONTRACT_CLASS;
1635
+ type SimulateTransactionResponse$2 = {
1636
+ transaction_trace: TRANSACTION_TRACE;
1637
+ fee_estimation: FEE_ESTIMATE;
1638
+ }[];
1639
+ type FeeEstimate = FEE_ESTIMATE;
1640
+ type TransactionWithHash = TXN & {
1641
+ transaction_hash: TXN_HASH;
1642
+ };
1643
+ type BlockHashAndNumber = {
1644
+ block_hash: BLOCK_HASH;
1645
+ block_number: BLOCK_NUMBER;
1646
+ };
1647
+ type BlockWithTxs = BLOCK_WITH_TXS | PENDING_BLOCK_WITH_TXS;
1648
+ type BlockWithTxHashes = BLOCK_WITH_TX_HASHES | PENDING_BLOCK_WITH_TX_HASHES;
1649
+ type StateUpdate = STATE_UPDATE | PENDING_STATE_UPDATE;
1650
+ type BlockTransactionsTraces = {
1651
+ transaction_hash: FELT;
1652
+ trace_root: TRANSACTION_TRACE;
1653
+ }[];
1654
+ type Syncing = boolean | SYNC_STATUS;
1655
+ type Events = EVENTS_CHUNK;
1656
+ type InvokedTransaction = {
1657
+ transaction_hash: TXN_HASH;
1658
+ };
1659
+ type DeclaredTransaction = {
1660
+ transaction_hash: TXN_HASH;
1661
+ class_hash: FELT;
1662
+ };
1663
+ type DeployedAccountTransaction = {
1664
+ transaction_hash: TXN_HASH;
1665
+ contract_address: FELT;
1666
+ };
1667
+ type ContractAddress = ADDRESS;
1668
+ type Felt = FELT;
1669
+ type Nonce$2 = FELT;
1670
+ type TransactionHash = TXN_HASH;
1671
+ type TransactionTrace = TRANSACTION_TRACE;
1672
+ type BlockHash = BLOCK_HASH;
1673
+ type TransactionReceipt = TXN_RECEIPT | PENDING_TXN_RECEIPT;
1674
+ type EventFilter = EVENT_FILTER & RESULT_PAGE_REQUEST;
1675
+ type SimulationFlags$1 = Array<SIMULATION_FLAG$1>;
1676
+ type L1Message = MSG_FROM_L1;
1677
+ type BaseTransaction = BROADCASTED_TXN;
1678
+ type ChainId = CHAIN_ID;
1679
+ type Transaction$1 = TXN;
1680
+ type TransactionStatus = {
1681
+ finality_status: TXN_STATUS;
1682
+ execution_status?: TXN_EXECUTION_STATUS;
1683
+ };
1684
+ type StorageDiffs$1 = Array<CONTRACT_STORAGE_DIFF_ITEM>;
1685
+ type DeprecatedDeclaredClasses = Array<FELT>;
1686
+ type NonceUpdates = NONCE_UPDATE[];
1687
+ type ReplacedClasses$1 = REPLACED_CLASS[];
1688
+ declare enum ETransactionType {
1689
+ DECLARE = "DECLARE",
1690
+ DEPLOY = "DEPLOY",
1691
+ DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT",
1692
+ INVOKE = "INVOKE",
1693
+ L1_HANDLER = "L1_HANDLER"
1694
+ }
1695
+ declare enum ESimulationFlag {
1696
+ SKIP_VALIDATE = "SKIP_VALIDATE",
1697
+ SKIP_FEE_CHARGE = "SKIP_FEE_CHARGE"
1698
+ }
1699
+ declare enum ETransactionStatus {
1700
+ RECEIVED = "RECEIVED",
1701
+ REJECTED = "REJECTED",
1702
+ ACCEPTED_ON_L2 = "ACCEPTED_ON_L2",
1703
+ ACCEPTED_ON_L1 = "ACCEPTED_ON_L1"
1704
+ }
1705
+ declare enum ETransactionFinalityStatus {
1706
+ ACCEPTED_ON_L2 = "ACCEPTED_ON_L2",
1707
+ ACCEPTED_ON_L1 = "ACCEPTED_ON_L1"
1708
+ }
1709
+ declare enum ETransactionExecutionStatus {
1710
+ SUCCEEDED = "SUCCEEDED",
1711
+ REVERTED = "REVERTED"
1712
+ }
1713
+ declare enum EBlockTag {
1714
+ LATEST = "latest",
1715
+ PENDING = "pending"
1716
+ }
1717
+ declare enum EDataAvailabilityMode {
1718
+ L1 = "L1",
1719
+ L2 = "L2"
1720
+ }
1721
+
1722
+ type Methods = ReadMethods & WriteMethods & TraceMethods;
1723
+ type ReadMethods = {
1724
+ starknet_specVersion: {
1725
+ params: [];
1726
+ result: string;
1160
1727
  };
1161
- type SimulatedTransactions = SimulatedTransaction[];
1162
- type BaseTransaction = DECLARE_TXN | INVOKE_TXN | DEPLOY_ACCOUNT_TXN;
1163
- type Methods = {
1164
- starknet_getBlockWithTxHashes: {
1165
- params: {
1166
- block_id: BLOCK_ID;
1167
- };
1168
- result: BlockWithTxHashes;
1169
- errors: Errors.BLOCK_NOT_FOUND;
1170
- };
1171
- starknet_getBlockWithTxs: {
1172
- params: {
1173
- block_id: BLOCK_ID;
1174
- };
1175
- result: BlockWithTxs;
1176
- errors: Errors.BLOCK_NOT_FOUND;
1177
- };
1178
- starknet_getStateUpdate: {
1179
- params: {
1180
- block_id: BLOCK_ID;
1181
- };
1182
- result: StateUpdate;
1183
- errors: Errors.BLOCK_NOT_FOUND;
1728
+ starknet_getBlockWithTxHashes: {
1729
+ params: {
1730
+ block_id: BLOCK_ID;
1184
1731
  };
1185
- starknet_getStorageAt: {
1186
- params: {
1187
- contract_address: ADDRESS;
1188
- key: STORAGE_KEY;
1189
- block_id: BLOCK_ID;
1190
- };
1191
- result: Storage;
1192
- errors: Errors.CONTRACT_NOT_FOUND | Errors.BLOCK_NOT_FOUND;
1193
- };
1194
- starknet_getTransactionByHash: {
1195
- params: {
1196
- transaction_hash: TXN_HASH;
1197
- };
1198
- result: TransactionWithHash;
1199
- errors: Errors.TXN_HASH_NOT_FOUND;
1200
- };
1201
- starknet_getTransactionByBlockIdAndIndex: {
1202
- params: {
1203
- block_id: BLOCK_ID;
1204
- index: number;
1205
- };
1206
- result: TransactionWithHash;
1207
- errors: Errors.BLOCK_NOT_FOUND | Errors.INVALID_TXN_INDEX;
1208
- };
1209
- starknet_getTransactionReceipt: {
1210
- params: {
1211
- transaction_hash: TXN_HASH;
1212
- };
1213
- result: TransactionReceipt;
1214
- errors: Errors.TXN_HASH_NOT_FOUND;
1732
+ result: BlockWithTxHashes;
1733
+ errors: BLOCK_NOT_FOUND;
1734
+ };
1735
+ starknet_getBlockWithTxs: {
1736
+ params: {
1737
+ block_id: BLOCK_ID;
1215
1738
  };
1216
- starknet_getClass: {
1217
- params: {
1218
- block_id: BLOCK_ID;
1219
- class_hash: FELT;
1220
- };
1221
- result: ContractClass | DeprecatedContractClass;
1222
- errors: Errors.BLOCK_NOT_FOUND | Errors.CLASS_HASH_NOT_FOUND;
1739
+ result: BlockWithTxs;
1740
+ errors: BLOCK_NOT_FOUND;
1741
+ };
1742
+ starknet_getStateUpdate: {
1743
+ params: {
1744
+ block_id: BLOCK_ID;
1223
1745
  };
1224
- starknet_getClassHashAt: {
1225
- params: {
1226
- block_id: BLOCK_ID;
1227
- contract_address: ADDRESS;
1228
- };
1229
- result: FELT;
1230
- errors: Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND;
1746
+ result: STATE_UPDATE | PENDING_STATE_UPDATE;
1747
+ errors: BLOCK_NOT_FOUND;
1748
+ };
1749
+ starknet_getStorageAt: {
1750
+ params: {
1751
+ contract_address: ADDRESS;
1752
+ key: STORAGE_KEY;
1753
+ block_id: BLOCK_ID;
1231
1754
  };
1232
- starknet_getClassAt: {
1233
- params: {
1234
- block_id: BLOCK_ID;
1235
- contract_address: ADDRESS;
1236
- };
1237
- result: ContractClass | DeprecatedContractClass;
1238
- errors: Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND;
1755
+ result: FELT;
1756
+ errors: CONTRACT_NOT_FOUND | BLOCK_NOT_FOUND;
1757
+ };
1758
+ starknet_getTransactionStatus: {
1759
+ params: {
1760
+ transaction_hash: TXN_HASH;
1239
1761
  };
1240
- starknet_getBlockTransactionCount: {
1241
- params: {
1242
- block_id: BLOCK_ID;
1243
- };
1244
- result: number;
1245
- errors: Errors.BLOCK_NOT_FOUND;
1762
+ result: TransactionStatus;
1763
+ errors: TXN_HASH_NOT_FOUND;
1764
+ };
1765
+ starknet_getTransactionByHash: {
1766
+ params: {
1767
+ transaction_hash: TXN_HASH;
1246
1768
  };
1247
- starknet_call: {
1248
- params: {
1249
- request: FUNCTION_CALL;
1250
- block_id: BLOCK_ID;
1251
- };
1252
- result: Array<FELT>;
1253
- errors: Errors.CONTRACT_NOT_FOUND | Errors.INVALID_MESSAGE_SELECTOR | Errors.INVALID_CALL_DATA | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND;
1769
+ result: TransactionWithHash;
1770
+ errors: TXN_HASH_NOT_FOUND;
1771
+ };
1772
+ starknet_getTransactionByBlockIdAndIndex: {
1773
+ params: {
1774
+ block_id: BLOCK_ID;
1775
+ index: number;
1254
1776
  };
1255
- starknet_estimateFee: {
1256
- params: {
1257
- request: Array<BaseTransaction>;
1258
- block_id: BLOCK_ID;
1259
- };
1260
- result: Array<FEE_ESTIMATE>;
1261
- errors: Errors.CONTRACT_NOT_FOUND | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND;
1777
+ result: TransactionWithHash;
1778
+ errors: BLOCK_NOT_FOUND | INVALID_TXN_INDEX;
1779
+ };
1780
+ starknet_getTransactionReceipt: {
1781
+ params: {
1782
+ transaction_hash: TXN_HASH;
1262
1783
  };
1263
- /**
1264
- * estimate the L2 fee of a message sent on L1
1265
- * estimates the resources required by the l1_handler transaction induced by the message
1266
- */
1267
- starknet_estimateMessageFee: {
1268
- params: {
1269
- message: MSG_FROM_L1;
1270
- block_id: BLOCK_ID;
1271
- };
1272
- result: FEE_ESTIMATE;
1273
- errors: Errors.CONTRACT_NOT_FOUND | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND;
1784
+ result: TransactionReceipt;
1785
+ errors: TXN_HASH_NOT_FOUND;
1786
+ };
1787
+ starknet_getClass: {
1788
+ params: {
1789
+ block_id: BLOCK_ID;
1790
+ class_hash: FELT;
1274
1791
  };
1275
- starknet_blockNumber: {
1276
- params: {};
1277
- result: BLOCK_NUMBER;
1278
- errors: Errors.NO_BLOCKS;
1792
+ result: ContractClass;
1793
+ errors: BLOCK_NOT_FOUND | CLASS_HASH_NOT_FOUND;
1794
+ };
1795
+ starknet_getClassHashAt: {
1796
+ params: {
1797
+ block_id: BLOCK_ID;
1798
+ contract_address: ADDRESS;
1279
1799
  };
1280
- starknet_blockHashAndNumber: {
1281
- params: {};
1282
- result: BLOCK_HASH & BLOCK_NUMBER;
1283
- errors: Errors.NO_BLOCKS;
1800
+ result: FELT;
1801
+ errors: BLOCK_NOT_FOUND | CONTRACT_NOT_FOUND;
1802
+ };
1803
+ starknet_getClassAt: {
1804
+ params: {
1805
+ block_id: BLOCK_ID;
1806
+ contract_address: ADDRESS;
1284
1807
  };
1285
- starknet_chainId: {
1286
- params: {};
1287
- result: CHAIN_ID;
1808
+ result: ContractClass;
1809
+ errors: BLOCK_NOT_FOUND | CONTRACT_NOT_FOUND;
1810
+ };
1811
+ starknet_getBlockTransactionCount: {
1812
+ params: {
1813
+ block_id: BLOCK_ID;
1288
1814
  };
1289
- starknet_pendingTransactions: {
1290
- params: {};
1291
- result: PendingTransactions;
1815
+ result: number;
1816
+ errors: BLOCK_NOT_FOUND;
1817
+ };
1818
+ starknet_call: {
1819
+ params: {
1820
+ request: FUNCTION_CALL;
1821
+ block_id: BLOCK_ID;
1292
1822
  };
1293
- starknet_syncing: {
1294
- params: {};
1295
- result: SyncingStatus;
1823
+ result: FELT[];
1824
+ errors: CONTRACT_NOT_FOUND | CONTRACT_ERROR | BLOCK_NOT_FOUND;
1825
+ };
1826
+ starknet_estimateFee: {
1827
+ params: {
1828
+ request: BROADCASTED_TXN[];
1829
+ block_id: BLOCK_ID;
1296
1830
  };
1297
- starknet_getEvents: {
1298
- params: {
1299
- filter: EVENT_FILTER & RESULT_PAGE_REQUEST;
1300
- };
1301
- result: Events;
1302
- errors: Errors.PAGE_SIZE_TOO_BIG | Errors.INVALID_CONTINUATION_TOKEN | Errors.BLOCK_NOT_FOUND | Errors.TOO_MANY_KEYS_IN_FILTER;
1831
+ result: FeeEstimate[];
1832
+ errors: CONTRACT_NOT_FOUND | CONTRACT_ERROR | BLOCK_NOT_FOUND;
1833
+ };
1834
+ starknet_estimateMessageFee: {
1835
+ params: {
1836
+ message: MSG_FROM_L1;
1837
+ block_id: BLOCK_ID;
1303
1838
  };
1304
- starknet_getNonce: {
1305
- params: {
1306
- block_id: BLOCK_ID;
1307
- contract_address: ADDRESS;
1308
- };
1309
- result: FELT;
1310
- errors: Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND;
1839
+ result: FeeEstimate;
1840
+ errors: CONTRACT_NOT_FOUND | CONTRACT_ERROR | BLOCK_NOT_FOUND;
1841
+ };
1842
+ starknet_blockNumber: {
1843
+ params: [];
1844
+ result: BLOCK_NUMBER;
1845
+ errors: NO_BLOCKS;
1846
+ };
1847
+ starknet_blockHashAndNumber: {
1848
+ params: [];
1849
+ result: BlockHashAndNumber;
1850
+ errors: NO_BLOCKS;
1851
+ };
1852
+ starknet_chainId: {
1853
+ params: [];
1854
+ result: CHAIN_ID;
1855
+ };
1856
+ starknet_syncing: {
1857
+ params: [];
1858
+ result: Syncing;
1859
+ };
1860
+ starknet_getEvents: {
1861
+ params: {
1862
+ filter: EVENT_FILTER & RESULT_PAGE_REQUEST;
1311
1863
  };
1312
- starknet_addInvokeTransaction: {
1313
- params: {
1314
- invoke_transaction: INVOKE_TXN_V1;
1315
- };
1316
- result: InvokedTransaction;
1317
- errors: Errors.INSUFFICIENT_ACCOUNT_BALANCE | Errors.INSUFFICIENT_MAX_FEE | Errors.INVALID_TRANSACTION_NONCE | Errors.VALIDATION_FAILURE | Errors.NON_ACCOUNT | Errors.DUPLICATE_TX | Errors.UNSUPPORTED_TX_VERSION | Errors.UNEXPECTED_ERROR;
1864
+ result: Events;
1865
+ errors: PAGE_SIZE_TOO_BIG | INVALID_CONTINUATION_TOKEN | BLOCK_NOT_FOUND | TOO_MANY_KEYS_IN_FILTER;
1866
+ };
1867
+ starknet_getNonce: {
1868
+ params: {
1869
+ block_id: BLOCK_ID;
1870
+ contract_address: ADDRESS;
1318
1871
  };
1319
- starknet_addDeclareTransaction: {
1320
- params: {
1321
- declare_transaction: DECLARE_TXN;
1322
- };
1323
- result: DeclaredTransaction;
1324
- errors: Errors.CLASS_ALREADY_DECLARED | Errors.COMPILATION_FAILED | Errors.COMPILED_CLASS_HASH_MISMATCH | Errors.INSUFFICIENT_ACCOUNT_BALANCE | Errors.INSUFFICIENT_MAX_FEE | Errors.INVALID_TRANSACTION_NONCE | Errors.VALIDATION_FAILURE | Errors.NON_ACCOUNT | Errors.DUPLICATE_TX | Errors.CONTRACT_CLASS_SIZE_IS_TOO_LARGE | Errors.UNSUPPORTED_TX_VERSION | Errors.UNSUPPORTED_CONTRACT_CLASS_VERSION | Errors.UNEXPECTED_ERROR;
1872
+ result: Nonce$2;
1873
+ errors: BLOCK_NOT_FOUND | CONTRACT_NOT_FOUND;
1874
+ };
1875
+ };
1876
+ type WriteMethods = {
1877
+ starknet_addInvokeTransaction: {
1878
+ params: {
1879
+ invoke_transaction: BROADCASTED_INVOKE_TXN;
1325
1880
  };
1326
- starknet_addDeployAccountTransaction: {
1327
- params: {
1328
- deploy_account_transaction: DEPLOY_ACCOUNT_TXN;
1329
- };
1330
- result: {
1331
- transaction_hash: TXN_HASH;
1332
- contract_address: FELT;
1333
- };
1334
- errors: Errors.INSUFFICIENT_ACCOUNT_BALANCE | Errors.INSUFFICIENT_MAX_FEE | Errors.INVALID_TRANSACTION_NONCE | Errors.VALIDATION_FAILURE | Errors.NON_ACCOUNT | Errors.CLASS_HASH_NOT_FOUND | Errors.DUPLICATE_TX | Errors.UNSUPPORTED_TX_VERSION | Errors.UNEXPECTED_ERROR;
1881
+ result: InvokedTransaction;
1882
+ errors: INSUFFICIENT_ACCOUNT_BALANCE | INSUFFICIENT_MAX_FEE | INVALID_TRANSACTION_NONCE | VALIDATION_FAILURE | NON_ACCOUNT | DUPLICATE_TX | UNSUPPORTED_TX_VERSION | UNEXPECTED_ERROR;
1883
+ };
1884
+ starknet_addDeclareTransaction: {
1885
+ params: {
1886
+ declare_transaction: BROADCASTED_DECLARE_TXN;
1335
1887
  };
1336
- starknet_traceTransaction: {
1337
- params: {
1338
- transaction_hash: TXN_HASH;
1339
- };
1340
- result: Trace;
1341
- errors: Errors.INVALID_TXN_HASH | Errors.NO_TRACE_AVAILABLE;
1888
+ result: DeclaredTransaction;
1889
+ errors: CLASS_ALREADY_DECLARED | COMPILATION_FAILED | COMPILED_CLASS_HASH_MISMATCH | INSUFFICIENT_ACCOUNT_BALANCE | INSUFFICIENT_MAX_FEE | INVALID_TRANSACTION_NONCE | VALIDATION_FAILURE | NON_ACCOUNT | DUPLICATE_TX | CONTRACT_CLASS_SIZE_IS_TOO_LARGE | UNSUPPORTED_TX_VERSION | UNSUPPORTED_CONTRACT_CLASS_VERSION | UNEXPECTED_ERROR;
1890
+ };
1891
+ starknet_addDeployAccountTransaction: {
1892
+ params: {
1893
+ deploy_account_transaction: BROADCASTED_DEPLOY_ACCOUNT_TXN;
1342
1894
  };
1343
- starknet_traceBlockTransactions: {
1344
- params: {
1345
- block_hash: BLOCK_HASH;
1346
- };
1347
- result: Traces;
1348
- errors: Errors.INVALID_BLOCK_HASH;
1895
+ result: DeployedAccountTransaction;
1896
+ errors: INSUFFICIENT_ACCOUNT_BALANCE | INSUFFICIENT_MAX_FEE | INVALID_TRANSACTION_NONCE | VALIDATION_FAILURE | NON_ACCOUNT | CLASS_HASH_NOT_FOUND | DUPLICATE_TX | UNSUPPORTED_TX_VERSION | UNEXPECTED_ERROR;
1897
+ };
1898
+ };
1899
+ type TraceMethods = {
1900
+ starknet_traceTransaction: {
1901
+ params: {
1902
+ transaction_hash: TXN_HASH;
1349
1903
  };
1350
- /**
1351
- * simulate a given sequence of transactions on the requested state, and generate the execution traces.
1352
- * If one of the transactions is reverted, raises CONTRACT_ERROR
1353
- */
1354
- starknet_simulateTransactions: {
1355
- params: {
1356
- block_id: BLOCK_ID;
1357
- transactions: Array<BaseTransaction>;
1358
- simulation_flags: Array<SIMULATION_FLAG$1>;
1359
- };
1360
- result: SimulatedTransactions;
1361
- errors: Errors.CONTRACT_NOT_FOUND | Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND;
1904
+ result: TransactionTrace;
1905
+ errors: INVALID_TXN_HASH | NO_TRACE_AVAILABLE;
1906
+ };
1907
+ starknet_traceBlockTransactions: {
1908
+ params: {
1909
+ block_id: BLOCK_ID;
1362
1910
  };
1911
+ result: BlockTransactionsTraces;
1912
+ errors: BLOCK_NOT_FOUND;
1363
1913
  };
1364
- }
1365
- declare namespace Errors {
1366
- interface FAILED_TO_RECEIVE_TXN {
1367
- code: 1;
1368
- message: 'Failed to write transaction';
1369
- }
1370
- interface NO_TRACE_AVAILABLE {
1371
- code: 10;
1372
- message: 'No trace available for transaction';
1373
- data: {
1374
- status: 'RECEIVED' | 'REJECTED';
1914
+ starknet_simulateTransactions: {
1915
+ params: {
1916
+ block_id: BLOCK_ID;
1917
+ transactions: Array<BROADCASTED_TXN>;
1918
+ simulation_flags: Array<SIMULATION_FLAG$1>;
1375
1919
  };
1376
- }
1377
- interface CONTRACT_NOT_FOUND {
1378
- code: 20;
1379
- message: 'Contract not found';
1380
- }
1381
- interface INVALID_MESSAGE_SELECTOR {
1382
- code: 21;
1383
- message: 'Invalid message selector';
1384
- }
1385
- interface INVALID_CALL_DATA {
1386
- code: 22;
1387
- message: 'Invalid call data';
1388
- }
1389
- interface BLOCK_NOT_FOUND {
1390
- code: 24;
1391
- message: 'Block not found';
1392
- }
1393
- interface INVALID_TXN_HASH {
1394
- code: 25;
1395
- message: 'Invalid transaction hash';
1396
- }
1397
- interface INVALID_BLOCK_HASH {
1398
- code: 26;
1399
- message: 'Invalid block hash';
1400
- }
1401
- interface INVALID_TXN_INDEX {
1402
- code: 27;
1403
- message: 'Invalid transaction index in a block';
1404
- }
1405
- interface CLASS_HASH_NOT_FOUND {
1406
- code: 28;
1407
- message: 'Class hash not found';
1408
- }
1409
- interface TXN_HASH_NOT_FOUND {
1410
- code: 29;
1411
- message: 'Transaction hash not found';
1412
- }
1413
- interface PAGE_SIZE_TOO_BIG {
1414
- code: 31;
1415
- message: 'Requested page size is too big';
1416
- }
1417
- interface NO_BLOCKS {
1418
- code: 32;
1419
- message: 'There are no blocks';
1420
- }
1421
- interface INVALID_CONTINUATION_TOKEN {
1422
- code: 33;
1423
- message: 'The supplied continuation token is invalid or unknown';
1424
- }
1425
- interface TOO_MANY_KEYS_IN_FILTER {
1426
- code: 34;
1427
- message: 'Too many keys provided in a filter';
1428
- }
1429
- interface CONTRACT_ERROR {
1430
- code: 40;
1431
- message: 'Contract error';
1432
- }
1433
- interface CLASS_ALREADY_DECLARED {
1434
- code: 51;
1435
- message: 'Class already declared';
1436
- }
1437
- interface INVALID_TRANSACTION_NONCE {
1438
- code: 52;
1439
- message: 'Invalid transaction nonce';
1440
- }
1441
- interface INSUFFICIENT_MAX_FEE {
1442
- code: 53;
1443
- message: 'Max fee is smaller than the minimal transaction cost (validation plus fee transfer)';
1444
- }
1445
- interface INSUFFICIENT_ACCOUNT_BALANCE {
1446
- code: 54;
1447
- message: "Account balance is smaller than the transaction's max_fee";
1448
- }
1449
- interface VALIDATION_FAILURE {
1450
- code: 55;
1451
- message: 'Account validation failed';
1452
- }
1453
- interface COMPILATION_FAILED {
1454
- code: 56;
1455
- message: 'Compilation failed';
1456
- }
1457
- interface CONTRACT_CLASS_SIZE_IS_TOO_LARGE {
1458
- code: 57;
1459
- message: 'Contract class size it too large';
1460
- }
1461
- interface NON_ACCOUNT {
1462
- code: 58;
1463
- message: 'Sender address in not an account contract';
1464
- }
1465
- interface DUPLICATE_TX {
1466
- code: 59;
1467
- message: 'A transaction with the same hash already exists in the mempool';
1468
- }
1469
- interface COMPILED_CLASS_HASH_MISMATCH {
1470
- code: 60;
1471
- message: 'the compiled class hash did not match the one supplied in the transaction';
1472
- }
1473
- interface UNSUPPORTED_TX_VERSION {
1474
- code: 61;
1475
- message: 'the transaction version is not supported';
1476
- }
1477
- interface UNSUPPORTED_CONTRACT_CLASS_VERSION {
1478
- code: 62;
1479
- message: 'the contract class version is not supported';
1480
- }
1481
- interface UNEXPECTED_ERROR {
1482
- code: 63;
1483
- message: 'An unexpected error occured';
1484
- data: string;
1485
- }
1486
- }
1487
-
1488
- type Response = {
1489
- id: number;
1490
- jsonrpc: string;
1491
- result?: any;
1492
- error?: {
1493
- code: string;
1494
- message: string;
1920
+ result: SimulateTransactionResponse$2;
1921
+ errors: CONTRACT_NOT_FOUND | CONTRACT_ERROR | BLOCK_NOT_FOUND;
1495
1922
  };
1496
1923
  };
1497
- type ChainId = OPENRPC.CHAIN_ID;
1498
- type CallResponse = OPENRPC.CallResponse;
1499
- type ContractAddress = ADDRESS;
1500
- type Felt = FELT;
1501
- type Nonce$2 = OPENRPC.Nonce;
1502
- type ContractClass = OPENRPC.ContractClass | OPENRPC.DeprecatedContractClass;
1503
- type StateUpdate = OPENRPC.StateUpdate;
1504
- type Transaction$1 = OPENRPC.Transaction;
1505
- type PendingTransactions = OPENRPC.PendingTransactions;
1506
- type TransactionHash = OPENRPC.TransactionHash;
1507
- type Trace = OPENRPC.Trace;
1508
- type Traces = OPENRPC.Traces;
1509
- type BlockHash = OPENRPC.BlockHash;
1510
- type BlockHashAndNumber = OPENRPC.BlockHashAndNumber;
1511
- type EstimateFeeResponse$2 = OPENRPC.EstimatedFee;
1512
- type GetBlockWithTxHashesResponse = OPENRPC.BlockWithTxHashes;
1513
- type GetBlockWithTxs = OPENRPC.BlockWithTxs;
1514
- type GetStorageAtResponse = OPENRPC.Storage;
1515
- type TransactionReceipt = OPENRPC.TransactionReceipt;
1516
- type GetTransactionByHashResponse = OPENRPC.Transaction;
1517
- type GetTransactionByBlockIdAndIndex = OPENRPC.Transaction;
1518
- type GetTransactionCountResponse = number;
1519
- type GetBlockNumberResponse = OPENRPC.BlockNumber;
1520
- type GetSyncingStatsResponse = OPENRPC.SyncingStatus;
1521
- type EventFilter = OPENRPC.EventFilter;
1522
- type GetEventsResponse = OPENRPC.Events;
1523
- type InvokedTransaction = OPENRPC.InvokedTransaction;
1524
- type DeclaredTransaction = OPENRPC.DeclaredTransaction;
1525
- type DeployedTransaction = OPENRPC.DeployedTransaction;
1526
- type SimulationFlags$1 = OPENRPC.SimulationFlags;
1527
- type EstimatedFee = OPENRPC.EstimatedFee;
1528
- type Methods = OPENRPC.Methods;
1529
- type Storage$2 = OPENRPC.Storage;
1530
- type SimulateTransactionResponse$2 = OPENRPC.SimulatedTransactions;
1531
- declare const TransactionType: typeof TXN_TYPE;
1532
- declare const SimulationFlag: typeof SIMULATION_FLAG$1;
1533
- declare const TransactionFinalityStatus: typeof TXN_FINALITY_STATUS;
1534
- declare const TransactionExecutionStatus: typeof TXN_EXECUTION_STATUS;
1535
- type BaseTransaction = OPENRPC.BaseTransaction & {
1536
- version: string;
1924
+
1925
+ /**
1926
+ * TypeScript Representation of Cairo1 v2+ Starknet Contract ABI
1927
+ *
1928
+ * starknet_metadata.json - tags/v0.5.0
1929
+ *
1930
+ * 'starknet-specs' (OpenRpc protocol types)
1931
+ * https://github.com/starkware-libs/starknet-specs
1932
+ */
1933
+ type ABI = Array<FUNCTION | CONSTRUCTOR | L1_HANDLER | EVENT | STRUCT | ENUM | INTERFACE | IMPL>;
1934
+ type FUNCTION = {
1935
+ type: 'function';
1936
+ name: string;
1937
+ inputs: Array<{
1938
+ name: string;
1939
+ type: string;
1940
+ }>;
1941
+ outputs?: Array<{
1942
+ type: string;
1943
+ }>;
1944
+ state_mutability: 'view' | 'external';
1945
+ };
1946
+ type CONSTRUCTOR = {
1947
+ type: 'constructor';
1948
+ name: 'constructor';
1949
+ inputs: Array<{
1950
+ name: string;
1951
+ type: string;
1952
+ }>;
1953
+ };
1954
+ type L1_HANDLER = {
1955
+ type: 'l1_handler';
1956
+ name: string;
1957
+ inputs: Array<{
1958
+ name: string;
1959
+ type: string;
1960
+ }>;
1961
+ outputs?: Array<{
1962
+ type: string;
1963
+ }>;
1964
+ state_mutability: 'view' | 'external';
1965
+ };
1966
+ type EVENT = {
1967
+ type: 'event';
1968
+ name: string;
1969
+ } & (ENUM_EVENT | STRUCT_EVENT);
1970
+ type STRUCT_EVENT = {
1971
+ kind: 'struct';
1972
+ members: Array<EVENT_FIELD>;
1973
+ };
1974
+ type ENUM_EVENT = {
1975
+ kind: 'enum';
1976
+ variants: Array<EVENT_FIELD>;
1977
+ };
1978
+ type STRUCT = {
1979
+ type: 'struct';
1980
+ name: string;
1981
+ members: Array<{
1982
+ name: string;
1983
+ type: string;
1984
+ }>;
1985
+ };
1986
+ type ENUM = {
1987
+ type: 'enum';
1988
+ name: string;
1989
+ variants: Array<{
1990
+ name: string;
1991
+ type: string;
1992
+ }>;
1993
+ };
1994
+ type INTERFACE = {
1995
+ type: 'interface';
1996
+ name: string;
1997
+ items: Array<FUNCTION>;
1998
+ };
1999
+ type IMPL = {
2000
+ type: 'impl';
2001
+ name: string;
2002
+ interface_name: string;
2003
+ };
2004
+ type EVENT_FIELD = {
2005
+ name: string;
2006
+ type: string;
2007
+ kind: 'key' | 'data' | 'nested';
1537
2008
  };
1538
- type StorageDiffs$1 = Array<CONTRACT_STORAGE_DIFF_ITEM>;
1539
- type DeprecatedDeclaredClasses = Array<FELT>;
1540
- type Nonces$1 = Array<{
1541
- contract_address: ADDRESS;
1542
- nonce: FELT;
1543
- }>;
1544
- type ReplacedClasses$1 = Array<{
1545
- contract_address: ADDRESS;
1546
- class_hash: FELT;
1547
- }>;
1548
2009
 
2010
+ type rpc_ABI = ABI;
1549
2011
  type rpc_BaseTransaction = BaseTransaction;
1550
2012
  type rpc_BlockHash = BlockHash;
1551
2013
  type rpc_BlockHashAndNumber = BlockHashAndNumber;
1552
- type rpc_CallResponse = CallResponse;
2014
+ type rpc_BlockTransactionsTraces = BlockTransactionsTraces;
2015
+ type rpc_BlockWithTxHashes = BlockWithTxHashes;
2016
+ type rpc_BlockWithTxs = BlockWithTxs;
1553
2017
  type rpc_ChainId = ChainId;
1554
2018
  type rpc_ContractAddress = ContractAddress;
1555
2019
  type rpc_ContractClass = ContractClass;
1556
2020
  type rpc_DeclaredTransaction = DeclaredTransaction;
1557
- type rpc_DeployedTransaction = DeployedTransaction;
2021
+ type rpc_DeployedAccountTransaction = DeployedAccountTransaction;
1558
2022
  type rpc_DeprecatedDeclaredClasses = DeprecatedDeclaredClasses;
1559
- type rpc_EstimatedFee = EstimatedFee;
2023
+ type rpc_EBlockTag = EBlockTag;
2024
+ declare const rpc_EBlockTag: typeof EBlockTag;
2025
+ type rpc_EDataAvailabilityMode = EDataAvailabilityMode;
2026
+ declare const rpc_EDataAvailabilityMode: typeof EDataAvailabilityMode;
2027
+ type rpc_ESimulationFlag = ESimulationFlag;
2028
+ declare const rpc_ESimulationFlag: typeof ESimulationFlag;
2029
+ type rpc_ETransactionExecutionStatus = ETransactionExecutionStatus;
2030
+ declare const rpc_ETransactionExecutionStatus: typeof ETransactionExecutionStatus;
2031
+ type rpc_ETransactionFinalityStatus = ETransactionFinalityStatus;
2032
+ declare const rpc_ETransactionFinalityStatus: typeof ETransactionFinalityStatus;
2033
+ type rpc_ETransactionStatus = ETransactionStatus;
2034
+ declare const rpc_ETransactionStatus: typeof ETransactionStatus;
2035
+ type rpc_ETransactionType = ETransactionType;
2036
+ declare const rpc_ETransactionType: typeof ETransactionType;
1560
2037
  type rpc_EventFilter = EventFilter;
2038
+ type rpc_Events = Events;
2039
+ type rpc_FeeEstimate = FeeEstimate;
1561
2040
  type rpc_Felt = Felt;
1562
- type rpc_GetBlockNumberResponse = GetBlockNumberResponse;
1563
- type rpc_GetBlockWithTxHashesResponse = GetBlockWithTxHashesResponse;
1564
- type rpc_GetBlockWithTxs = GetBlockWithTxs;
1565
- type rpc_GetEventsResponse = GetEventsResponse;
1566
- type rpc_GetStorageAtResponse = GetStorageAtResponse;
1567
- type rpc_GetSyncingStatsResponse = GetSyncingStatsResponse;
1568
- type rpc_GetTransactionByBlockIdAndIndex = GetTransactionByBlockIdAndIndex;
1569
- type rpc_GetTransactionByHashResponse = GetTransactionByHashResponse;
1570
- type rpc_GetTransactionCountResponse = GetTransactionCountResponse;
1571
2041
  type rpc_InvokedTransaction = InvokedTransaction;
2042
+ type rpc_L1Message = L1Message;
1572
2043
  type rpc_Methods = Methods;
1573
- type rpc_PendingTransactions = PendingTransactions;
1574
- type rpc_Response = Response;
1575
- declare const rpc_SimulationFlag: typeof SimulationFlag;
2044
+ type rpc_NonceUpdates = NonceUpdates;
1576
2045
  type rpc_StateUpdate = StateUpdate;
1577
- type rpc_Trace = Trace;
1578
- type rpc_Traces = Traces;
1579
- declare const rpc_TransactionExecutionStatus: typeof TransactionExecutionStatus;
1580
- declare const rpc_TransactionFinalityStatus: typeof TransactionFinalityStatus;
2046
+ type rpc_Syncing = Syncing;
1581
2047
  type rpc_TransactionHash = TransactionHash;
1582
2048
  type rpc_TransactionReceipt = TransactionReceipt;
1583
- declare const rpc_TransactionType: typeof TransactionType;
2049
+ type rpc_TransactionStatus = TransactionStatus;
2050
+ type rpc_TransactionTrace = TransactionTrace;
2051
+ type rpc_TransactionWithHash = TransactionWithHash;
1584
2052
  declare namespace rpc {
1585
2053
  export {
2054
+ rpc_ABI as ABI,
1586
2055
  rpc_BaseTransaction as BaseTransaction,
1587
2056
  rpc_BlockHash as BlockHash,
1588
2057
  rpc_BlockHashAndNumber as BlockHashAndNumber,
1589
- rpc_CallResponse as CallResponse,
2058
+ rpc_BlockTransactionsTraces as BlockTransactionsTraces,
2059
+ rpc_BlockWithTxHashes as BlockWithTxHashes,
2060
+ rpc_BlockWithTxs as BlockWithTxs,
1590
2061
  rpc_ChainId as ChainId,
1591
2062
  rpc_ContractAddress as ContractAddress,
1592
2063
  rpc_ContractClass as ContractClass,
1593
2064
  rpc_DeclaredTransaction as DeclaredTransaction,
1594
- rpc_DeployedTransaction as DeployedTransaction,
2065
+ rpc_DeployedAccountTransaction as DeployedAccountTransaction,
1595
2066
  rpc_DeprecatedDeclaredClasses as DeprecatedDeclaredClasses,
1596
- EstimateFeeResponse$2 as EstimateFeeResponse,
1597
- rpc_EstimatedFee as EstimatedFee,
2067
+ rpc_EBlockTag as EBlockTag,
2068
+ rpc_EDataAvailabilityMode as EDataAvailabilityMode,
2069
+ rpc_ESimulationFlag as ESimulationFlag,
2070
+ rpc_ETransactionExecutionStatus as ETransactionExecutionStatus,
2071
+ rpc_ETransactionFinalityStatus as ETransactionFinalityStatus,
2072
+ rpc_ETransactionStatus as ETransactionStatus,
2073
+ rpc_ETransactionType as ETransactionType,
2074
+ errors as Errors,
1598
2075
  rpc_EventFilter as EventFilter,
2076
+ rpc_Events as Events,
2077
+ rpc_FeeEstimate as FeeEstimate,
1599
2078
  rpc_Felt as Felt,
1600
- rpc_GetBlockNumberResponse as GetBlockNumberResponse,
1601
- rpc_GetBlockWithTxHashesResponse as GetBlockWithTxHashesResponse,
1602
- rpc_GetBlockWithTxs as GetBlockWithTxs,
1603
- rpc_GetEventsResponse as GetEventsResponse,
1604
- rpc_GetStorageAtResponse as GetStorageAtResponse,
1605
- rpc_GetSyncingStatsResponse as GetSyncingStatsResponse,
1606
- rpc_GetTransactionByBlockIdAndIndex as GetTransactionByBlockIdAndIndex,
1607
- rpc_GetTransactionByHashResponse as GetTransactionByHashResponse,
1608
- rpc_GetTransactionCountResponse as GetTransactionCountResponse,
1609
2079
  rpc_InvokedTransaction as InvokedTransaction,
2080
+ index$2 as JRPC,
2081
+ rpc_L1Message as L1Message,
1610
2082
  rpc_Methods as Methods,
1611
2083
  Nonce$2 as Nonce,
1612
- Nonces$1 as Nonces,
1613
- rpc_PendingTransactions as PendingTransactions,
2084
+ rpc_NonceUpdates as NonceUpdates,
1614
2085
  ReplacedClasses$1 as ReplacedClasses,
1615
- rpc_Response as Response,
2086
+ components as SPEC,
1616
2087
  SimulateTransactionResponse$2 as SimulateTransactionResponse,
1617
- rpc_SimulationFlag as SimulationFlag,
1618
2088
  SimulationFlags$1 as SimulationFlags,
1619
2089
  rpc_StateUpdate as StateUpdate,
1620
- Storage$2 as Storage,
1621
2090
  StorageDiffs$1 as StorageDiffs,
1622
- rpc_Trace as Trace,
1623
- rpc_Traces as Traces,
2091
+ rpc_Syncing as Syncing,
1624
2092
  Transaction$1 as Transaction,
1625
- rpc_TransactionExecutionStatus as TransactionExecutionStatus,
1626
- rpc_TransactionFinalityStatus as TransactionFinalityStatus,
1627
2093
  rpc_TransactionHash as TransactionHash,
1628
2094
  rpc_TransactionReceipt as TransactionReceipt,
1629
- rpc_TransactionType as TransactionType,
2095
+ rpc_TransactionStatus as TransactionStatus,
2096
+ rpc_TransactionTrace as TransactionTrace,
2097
+ rpc_TransactionWithHash as TransactionWithHash,
1630
2098
  };
1631
2099
  }
1632
2100
 
1633
2101
  type GetTransactionStatusResponse = {
1634
- tx_status: TransactionStatus;
1635
- execution_status: TransactionExecutionStatus$1;
1636
- finality_status: TransactionFinalityStatus$1;
2102
+ tx_status: TransactionStatus$1;
2103
+ execution_status: TransactionExecutionStatus;
2104
+ finality_status: TransactionFinalityStatus;
1637
2105
  block_hash?: string;
1638
2106
  tx_failure_reason?: {
1639
2107
  code: string;
@@ -1694,7 +2162,7 @@ type TransactionTraceResponse = {
1694
2162
  signature: string[];
1695
2163
  };
1696
2164
  type DeclareTransaction = {
1697
- type: TransactionType$1.DECLARE;
2165
+ type: TransactionType.DECLARE;
1698
2166
  sender_address: string;
1699
2167
  contract_class: ContractClass$1;
1700
2168
  signature?: string[];
@@ -1704,14 +2172,14 @@ type DeclareTransaction = {
1704
2172
  compiled_class_hash?: string;
1705
2173
  };
1706
2174
  type DeployTransaction = {
1707
- type: TransactionType$1.DEPLOY;
2175
+ type: TransactionType.DEPLOY;
1708
2176
  contract_definition: ContractClass$1;
1709
2177
  contract_address_salt: BigNumberish;
1710
2178
  constructor_calldata: string[];
1711
2179
  nonce?: BigNumberish;
1712
2180
  };
1713
2181
  type DeployAccountTransaction = {
1714
- type: TransactionType$1.DEPLOY_ACCOUNT;
2182
+ type: TransactionType.DEPLOY_ACCOUNT;
1715
2183
  class_hash: string;
1716
2184
  contract_address_salt: BigNumberish;
1717
2185
  constructor_calldata: string[];
@@ -1721,7 +2189,7 @@ type DeployAccountTransaction = {
1721
2189
  nonce?: BigNumberish;
1722
2190
  };
1723
2191
  type InvokeFunctionTransaction = {
1724
- type: TransactionType$1.INVOKE;
2192
+ type: TransactionType.INVOKE;
1725
2193
  sender_address: string;
1726
2194
  signature?: string[];
1727
2195
  entry_point_type?: EntryPointType.EXTERNAL;
@@ -1747,18 +2215,18 @@ interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction {
1747
2215
  }
1748
2216
  type TransactionResponse = DeclareTransaction | DeployTransaction | InvokeFunctionTransactionResponse;
1749
2217
  type SuccessfulTransactionResponse = {
1750
- execution_status: TransactionExecutionStatus$1.SUCCEEDED;
1751
- finality_status: TransactionFinalityStatus$1;
1752
- status: TransactionStatus;
2218
+ execution_status: TransactionExecutionStatus.SUCCEEDED;
2219
+ finality_status: TransactionFinalityStatus;
2220
+ status: TransactionStatus$1;
1753
2221
  block_hash: string;
1754
2222
  block_number: BlockNumber;
1755
2223
  transaction_index: number;
1756
2224
  transaction: TransactionResponse;
1757
2225
  };
1758
2226
  type RevertedTransactionResponse = {
1759
- execution_status: TransactionExecutionStatus$1.REVERTED;
1760
- finality_status: TransactionFinalityStatus$1;
1761
- status: TransactionStatus;
2227
+ execution_status: TransactionExecutionStatus.REVERTED;
2228
+ finality_status: TransactionFinalityStatus;
2229
+ status: TransactionStatus$1;
1762
2230
  block_hash: string;
1763
2231
  block_number: BlockNumber;
1764
2232
  transaction_index: number;
@@ -1766,7 +2234,7 @@ type RevertedTransactionResponse = {
1766
2234
  revert_error: string;
1767
2235
  };
1768
2236
  type FailedTransactionResponse = {
1769
- status: TransactionStatus.REJECTED;
2237
+ status: TransactionStatus$1.REJECTED;
1770
2238
  transaction_failure_reason: {
1771
2239
  code: string;
1772
2240
  error_message: string;
@@ -1776,9 +2244,9 @@ type FailedTransactionResponse = {
1776
2244
  type GetTransactionResponse$1 = SuccessfulTransactionResponse | RevertedTransactionResponse | FailedTransactionResponse;
1777
2245
  type TransactionReceiptResponse = SuccessfulTransactionReceiptResponse$1 | RevertedTransactionReceiptResponse$1 | RejectedTransactionReceiptResponse$1;
1778
2246
  type SuccessfulTransactionReceiptResponse$1 = {
1779
- execution_status: TransactionExecutionStatus$1.SUCCEEDED;
1780
- finality_status: TransactionFinalityStatus$1;
1781
- status: TransactionStatus;
2247
+ execution_status: TransactionExecutionStatus.SUCCEEDED;
2248
+ finality_status: TransactionFinalityStatus;
2249
+ status: TransactionStatus$1;
1782
2250
  actual_fee: string;
1783
2251
  block_hash: string;
1784
2252
  block_number: BlockNumber;
@@ -1789,9 +2257,9 @@ type SuccessfulTransactionReceiptResponse$1 = {
1789
2257
  execution_resources?: ExecutionResources;
1790
2258
  };
1791
2259
  type RevertedTransactionReceiptResponse$1 = {
1792
- execution_status: TransactionExecutionStatus$1.REVERTED;
1793
- finality_status: TransactionFinalityStatus$1;
1794
- status: TransactionStatus.REVERTED;
2260
+ execution_status: TransactionExecutionStatus.REVERTED;
2261
+ finality_status: TransactionFinalityStatus;
2262
+ status: TransactionStatus$1.REVERTED;
1795
2263
  actual_fee: string;
1796
2264
  block_hash: string;
1797
2265
  block_number: BlockNumber;
@@ -1802,9 +2270,9 @@ type RevertedTransactionReceiptResponse$1 = {
1802
2270
  revert_error: string;
1803
2271
  };
1804
2272
  type RejectedTransactionReceiptResponse$1 = {
1805
- execution_status: TransactionExecutionStatus$1.REJECTED;
1806
- finality_status: TransactionFinalityStatus$1;
1807
- status: TransactionStatus.REJECTED;
2273
+ execution_status: TransactionExecutionStatus.REJECTED;
2274
+ finality_status: TransactionFinalityStatus;
2275
+ status: TransactionStatus$1.REJECTED;
1808
2276
  transaction_hash: string;
1809
2277
  l2_to_l1_messages: string[];
1810
2278
  events: string[];
@@ -1831,7 +2299,7 @@ type GetBlockResponse$1 = {
1831
2299
  from_address: string;
1832
2300
  }[];
1833
2301
  block_number: BlockNumber;
1834
- status: TransactionStatus;
2302
+ status: TransactionStatus$1;
1835
2303
  transaction_index: number;
1836
2304
  };
1837
2305
  };
@@ -2223,7 +2691,7 @@ interface MessageToL2 {
2223
2691
  payload: Array<string>;
2224
2692
  }
2225
2693
  type RejectedTransactionResponse = {
2226
- status: `${TransactionStatus.REJECTED}`;
2694
+ status: `${TransactionStatus$1.REJECTED}`;
2227
2695
  transaction_failure_reason: {
2228
2696
  code: string;
2229
2697
  error_message: string;
@@ -2232,10 +2700,10 @@ type RejectedTransactionResponse = {
2232
2700
  type GetTransactionReceiptResponse = SuccessfulTransactionReceiptResponse | RevertedTransactionReceiptResponse | RejectedTransactionReceiptResponse;
2233
2701
  type SuccessfulTransactionReceiptResponse = InvokeTransactionReceiptResponse | DeployTransactionReceiptResponse | DeclareTransactionReceiptResponse;
2234
2702
  interface InvokeTransactionReceiptResponse {
2235
- type?: TransactionType$1;
2236
- execution_status: TransactionExecutionStatus$1;
2237
- finality_status: TransactionFinalityStatus$1;
2238
- status?: `${TransactionStatus}`;
2703
+ type?: TransactionType;
2704
+ execution_status: TransactionExecutionStatus;
2705
+ finality_status: TransactionFinalityStatus;
2706
+ status?: `${TransactionStatus$1}`;
2239
2707
  actual_fee: string;
2240
2708
  block_hash: BlockHash;
2241
2709
  block_number: BlockNumber;
@@ -2246,10 +2714,10 @@ interface InvokeTransactionReceiptResponse {
2246
2714
  execution_resources?: any;
2247
2715
  }
2248
2716
  type DeclareTransactionReceiptResponse = {
2249
- type?: TransactionType$1;
2250
- execution_status: TransactionExecutionStatus$1;
2251
- finality_status: TransactionFinalityStatus$1;
2252
- status?: `${TransactionStatus}`;
2717
+ type?: TransactionType;
2718
+ execution_status: TransactionExecutionStatus;
2719
+ finality_status: TransactionFinalityStatus;
2720
+ status?: `${TransactionStatus$1}`;
2253
2721
  actual_fee: string;
2254
2722
  block_hash: BlockHash;
2255
2723
  block_number: BlockNumber;
@@ -2260,17 +2728,17 @@ type DeclareTransactionReceiptResponse = {
2260
2728
  };
2261
2729
  type DeployTransactionReceiptResponse = InvokeTransactionReceiptResponse;
2262
2730
  type RejectedTransactionReceiptResponse = {
2263
- status: `${TransactionStatus.REJECTED}`;
2731
+ status: `${TransactionStatus$1.REJECTED}`;
2264
2732
  transaction_failure_reason: {
2265
2733
  code: string;
2266
2734
  error_message: string;
2267
2735
  };
2268
2736
  };
2269
2737
  type RevertedTransactionReceiptResponse = {
2270
- type?: TransactionType$1 | any;
2271
- execution_status: TransactionExecutionStatus$1.REVERTED | any;
2272
- finality_status: TransactionFinalityStatus$1 | any;
2273
- status?: TransactionStatus;
2738
+ type?: TransactionType | any;
2739
+ execution_status: TransactionExecutionStatus.REVERTED | any;
2740
+ finality_status: TransactionFinalityStatus | any;
2741
+ status?: TransactionStatus$1;
2274
2742
  actual_fee: string;
2275
2743
  block_hash?: string;
2276
2744
  block_number?: BlockNumber;
@@ -2297,16 +2765,16 @@ type CallContractResponse = {
2297
2765
  result: Array<string>;
2298
2766
  };
2299
2767
  type EstimateFeeAction = {
2300
- type: TransactionType$1.INVOKE;
2768
+ type: TransactionType.INVOKE;
2301
2769
  payload: AllowArray<Call>;
2302
2770
  } | {
2303
- type: TransactionType$1.DECLARE;
2771
+ type: TransactionType.DECLARE;
2304
2772
  payload: DeclareContractPayload;
2305
2773
  } | {
2306
- type: TransactionType$1.DEPLOY_ACCOUNT;
2774
+ type: TransactionType.DEPLOY_ACCOUNT;
2307
2775
  payload: DeployAccountContractPayload;
2308
2776
  } | {
2309
- type: TransactionType$1.DEPLOY;
2777
+ type: TransactionType.DEPLOY;
2310
2778
  payload: UniversalDeployerContractPayload;
2311
2779
  };
2312
2780
  type EstimateFeeResponseBulk = Array<EstimateFeeResponse>;
@@ -2314,8 +2782,8 @@ type Storage = Storage$1;
2314
2782
  type Nonce = Nonce$1;
2315
2783
  type SimulationFlags = SimulationFlags$1;
2316
2784
  type SimulatedTransaction = {
2317
- transaction_trace: Trace | TransactionTraceResponse;
2318
- fee_estimation: EstimateFeeResponse$2 | EstimateFeeResponse$1;
2785
+ transaction_trace: TransactionTrace | TransactionTraceResponse;
2786
+ fee_estimation: FeeEstimate | EstimateFeeResponse$1;
2319
2787
  suggestedMaxFee?: string | bigint;
2320
2788
  };
2321
2789
  type SimulateTransactionResponse = SimulatedTransaction[];
@@ -2326,7 +2794,7 @@ interface StateUpdateResponse {
2326
2794
  state_diff: {
2327
2795
  storage_diffs: StorageDiffs$1;
2328
2796
  deployed_contracts: DeployedContracts;
2329
- nonces: Nonces$1;
2797
+ nonces: NonceUpdates;
2330
2798
  old_declared_contracts?: OldDeclaredContracts;
2331
2799
  declared_classes?: DeclaredClasses;
2332
2800
  replaced_classes?: ReplacedClasses | ReplacedClasses$1;
@@ -2630,8 +3098,12 @@ type index$1_StateUpdateResponse = StateUpdateResponse;
2630
3098
  type index$1_Storage = Storage;
2631
3099
  type index$1_StructAbi = StructAbi;
2632
3100
  type index$1_SuccessfulTransactionReceiptResponse = SuccessfulTransactionReceiptResponse;
2633
- type index$1_TransactionStatus = TransactionStatus;
2634
- declare const index$1_TransactionStatus: typeof TransactionStatus;
3101
+ type index$1_TransactionExecutionStatus = TransactionExecutionStatus;
3102
+ declare const index$1_TransactionExecutionStatus: typeof TransactionExecutionStatus;
3103
+ type index$1_TransactionFinalityStatus = TransactionFinalityStatus;
3104
+ declare const index$1_TransactionFinalityStatus: typeof TransactionFinalityStatus;
3105
+ type index$1_TransactionType = TransactionType;
3106
+ declare const index$1_TransactionType: typeof TransactionType;
2635
3107
  type index$1_Tupled = Tupled;
2636
3108
  type index$1_TypedData = TypedData;
2637
3109
  type index$1_Uint = Uint;
@@ -2788,10 +3260,10 @@ declare namespace index$1 {
2788
3260
  index$1_Storage as Storage,
2789
3261
  index$1_StructAbi as StructAbi,
2790
3262
  index$1_SuccessfulTransactionReceiptResponse as SuccessfulTransactionReceiptResponse,
2791
- TransactionExecutionStatus$1 as TransactionExecutionStatus,
2792
- TransactionFinalityStatus$1 as TransactionFinalityStatus,
2793
- index$1_TransactionStatus as TransactionStatus,
2794
- TransactionType$1 as TransactionType,
3263
+ index$1_TransactionExecutionStatus as TransactionExecutionStatus,
3264
+ index$1_TransactionFinalityStatus as TransactionFinalityStatus,
3265
+ TransactionStatus$1 as TransactionStatus,
3266
+ index$1_TransactionType as TransactionType,
2795
3267
  index$1_Tupled as Tupled,
2796
3268
  index$1_TypedData as TypedData,
2797
3269
  index$1_Uint as Uint,
@@ -2841,7 +3313,7 @@ declare abstract class ProviderInterface {
2841
3313
  */
2842
3314
  abstract getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise<ContractClassResponse>;
2843
3315
  /**
2844
- * Returns the class hash deployed under the given address.
3316
+ * Returns the contract class hash in the given block for the contract deployed at the given address
2845
3317
  *
2846
3318
  * @param contractAddress - contract address
2847
3319
  * @param blockIdentifier - block identifier
@@ -2856,14 +3328,14 @@ declare abstract class ProviderInterface {
2856
3328
  */
2857
3329
  abstract getClassByHash(classHash: string): Promise<ContractClassResponse>;
2858
3330
  /**
2859
- * Gets the nonce of a contract with respect to a specific block
3331
+ * Returns the nonce associated with the given address in the given block
2860
3332
  *
2861
3333
  * @param contractAddress - contract address
2862
3334
  * @returns the hex nonce
2863
3335
  */
2864
3336
  abstract getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise<Nonce>;
2865
3337
  /**
2866
- * Gets the contract's storage variable at a specific key.
3338
+ * Get the value of the storage (contract's variable) at the given address and key
2867
3339
  *
2868
3340
  * @param contractAddress
2869
3341
  * @param key - from getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP)
@@ -3021,7 +3493,7 @@ declare abstract class ProviderInterface {
3021
3493
  */
3022
3494
  abstract getSimulateTransaction(invocations: AccountInvocations, options?: getSimulateTransactionOptions): Promise<SimulateTransactionResponse>;
3023
3495
  /**
3024
- * Gets the state changes in a specific block
3496
+ * Gets the state changes in a specific block (result of executing the requested block)
3025
3497
  *
3026
3498
  * @param blockIdentifier - block identifier
3027
3499
  * @returns StateUpdateResponse
@@ -3047,6 +3519,9 @@ declare abstract class ProviderInterface {
3047
3519
  abstract getContractVersion(contractAddress: undefined, classHash: string, options?: getContractVersionOptions): Promise<ContractVersion>;
3048
3520
  }
3049
3521
 
3522
+ /**
3523
+ * @deprecated Use RpcProvider instead. Common Provider will be removed with Sequencer provider.
3524
+ */
3050
3525
  declare class Provider implements ProviderInterface {
3051
3526
  private provider;
3052
3527
  constructor(providerOrOptions?: ProviderOptions | ProviderInterface);
@@ -3184,6 +3659,7 @@ declare class SequencerProvider implements ProviderInterface {
3184
3659
  buildTransaction(invocation: AccountInvocationItem, versionType?: 'fee' | 'transaction'): AccountTransactionItem;
3185
3660
  }
3186
3661
 
3662
+ declare const getDefaultNodeUrl: (networkName?: NetworkName, mute?: boolean) => string;
3187
3663
  declare class RpcProvider implements ProviderInterface {
3188
3664
  nodeUrl: string;
3189
3665
  headers: object;
@@ -3191,75 +3667,131 @@ declare class RpcProvider implements ProviderInterface {
3191
3667
  private retries;
3192
3668
  private blockIdentifier;
3193
3669
  private chainId?;
3194
- constructor(optionsOrProvider: RpcProviderOptions);
3195
- fetch(method: any, params: any): Promise<any>;
3196
- protected errorHandler(error: any): void;
3670
+ constructor(optionsOrProvider?: RpcProviderOptions);
3671
+ fetch(method: string, params?: object, id?: string | number): Promise<Response>;
3672
+ protected errorHandler(method: string, params: any, rpcError?: Error$1, otherError?: any): void;
3197
3673
  protected fetchEndpoint<T extends keyof Methods>(method: T, params?: Methods[T]['params']): Promise<Methods[T]['result']>;
3198
3674
  getChainId(): Promise<StarknetChainId>;
3675
+ /**
3676
+ * NEW: Returns the version of the Starknet JSON-RPC specification being used
3677
+ */
3678
+ getSpecVersion(): Promise<string>;
3679
+ getNonceForAddress(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<string>;
3680
+ /**
3681
+ * @deprecated use getBlockWithTxHashes or getBlockWithTxs (will be removed on sequencer deprecation)
3682
+ */
3199
3683
  getBlock(blockIdentifier?: BlockIdentifier): Promise<GetBlockResponse>;
3200
- getBlockHashAndNumber(): Promise<BlockHashAndNumber>;
3201
- getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise<GetBlockWithTxHashesResponse>;
3202
- getBlockWithTxs(blockIdentifier?: BlockIdentifier): Promise<GetBlockWithTxs>;
3203
- getClassHashAt(contractAddress: ContractAddress, blockIdentifier?: BlockIdentifier): Promise<Felt>;
3204
- getNonceForAddress(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise<Nonce$2>;
3205
- getPendingTransactions(): Promise<PendingTransactions>;
3206
- getProtocolVersion(): Promise<Error>;
3207
- getStateUpdate(blockIdentifier?: BlockIdentifier): Promise<StateUpdate>;
3208
- getStorageAt(contractAddress: string, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<Storage$2>;
3209
- getTransaction(txHash: string): Promise<GetTransactionResponse>;
3210
- getTransactionByHash(txHash: string): Promise<GetTransactionByHashResponse>;
3211
- getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<GetTransactionByBlockIdAndIndex>;
3212
- getTransactionReceipt(txHash: string): Promise<TransactionReceipt>;
3213
- getClassByHash(classHash: Felt): Promise<ContractClassResponse>;
3214
- getClass(classHash: Felt, blockIdentifier?: BlockIdentifier): Promise<ContractClassResponse>;
3215
- getClassAt(contractAddress: string, blockIdentifier?: BlockIdentifier): Promise<ContractClassResponse>;
3684
+ /**
3685
+ * @deprecated renamed to getBlockLatestAccepted(); (will be removed in next minor version)
3686
+ */
3687
+ getBlockHashAndNumber: () => Promise<BlockHashAndNumber>;
3688
+ /**
3689
+ * Get the most recent accepted block hash and number
3690
+ */
3691
+ getBlockLatestAccepted(): Promise<BlockHashAndNumber>;
3692
+ /**
3693
+ * @deprecated redundant use getBlockLatestAccepted();
3694
+ * Get the most recent accepted block number
3695
+ * @returns Number of the latest block
3696
+ */
3697
+ getBlockNumber(): Promise<number>;
3698
+ getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise<BlockWithTxHashes>;
3699
+ getBlockWithTxs(blockIdentifier?: BlockIdentifier): Promise<BlockWithTxs>;
3700
+ getBlockStateUpdate(blockIdentifier?: BlockIdentifier): Promise<PENDING_STATE_UPDATE | STATE_UPDATE>;
3701
+ /**
3702
+ * @deprecated renamed to getBlockStateUpdate();
3703
+ */
3704
+ getStateUpdate: (blockIdentifier?: BlockIdentifier) => Promise<PENDING_STATE_UPDATE | STATE_UPDATE>;
3705
+ getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<BlockTransactionsTraces>;
3706
+ /**
3707
+ * Returns the execution traces of all transactions included in the given block
3708
+ * @deprecated renamed to getBlockTransactionsTraces()
3709
+ */
3710
+ traceBlockTransactions: (blockIdentifier?: BlockIdentifier) => Promise<BlockTransactionsTraces>;
3711
+ getBlockTransactionCount(blockIdentifier?: BlockIdentifier): Promise<number>;
3712
+ /**
3713
+ * Get the number of transactions in a block given a block id
3714
+ * @deprecated renamed to getBlockTransactionCount()
3715
+ * @returns Number of transactions
3716
+ */
3717
+ getTransactionCount: (blockIdentifier?: BlockIdentifier) => Promise<number>;
3718
+ /**
3719
+ * Return transactions from pending block
3720
+ * @deprecated Instead use getBlock(BlockTag.pending); (will be removed in next minor version)
3721
+ */
3722
+ getPendingTransactions(): Promise<TransactionWithHash[]>;
3723
+ /**
3724
+ * @deprecated use getTransactionByHash or getTransactionByBlockIdAndIndex (will be removed on sequencer deprecation)
3725
+ */
3726
+ getTransaction(txHash: BigNumberish): Promise<InvokeTransactionResponse | DeclareTransactionResponse | RejectedTransactionResponse>;
3727
+ getTransactionByHash(txHash: BigNumberish): Promise<TransactionWithHash>;
3728
+ getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<TransactionWithHash>;
3729
+ getTransactionReceipt(txHash: BigNumberish): Promise<TransactionReceipt>;
3730
+ getTransactionTrace(txHash: BigNumberish): Promise<TRANSACTION_TRACE>;
3731
+ /**
3732
+ * @deprecated renamed to getTransactionTrace();
3733
+ * For a given executed transaction, return the trace of its execution, including internal calls
3734
+ */
3735
+ traceTransaction: (txHash: BigNumberish) => Promise<TRANSACTION_TRACE>;
3736
+ /**
3737
+ * NEW: Get the status of a transaction
3738
+ */
3739
+ getTransactionStatus(transactionHash: BigNumberish): Promise<TransactionStatus>;
3740
+ /**
3741
+ * @deprecated renamed to simulateTransaction();
3742
+ */
3743
+ getSimulateTransaction: (invocations: AccountInvocations, { blockIdentifier, skipValidate, skipFeeCharge, }: getSimulateTransactionOptions) => Promise<SimulateTransactionResponse>;
3744
+ /**
3745
+ * @param invocations AccountInvocations
3746
+ * @param simulateTransactionOptions blockIdentifier and flags to skip validation and fee charge<br/>
3747
+ * - blockIdentifier<br/>
3748
+ * - skipValidate (default false)<br/>
3749
+ * - skipFeeCharge (default true)<br/>
3750
+ */
3751
+ simulateTransaction(invocations: AccountInvocations, { blockIdentifier, skipValidate, skipFeeCharge, }: getSimulateTransactionOptions): Promise<SimulateTransactionResponse>;
3752
+ waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise<TransactionReceipt>;
3753
+ getStorageAt(contractAddress: BigNumberish, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<string>;
3754
+ getClassHashAt(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<string>;
3755
+ getClassByHash(classHash: BigNumberish): Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>;
3756
+ getClass(classHash: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>;
3757
+ getClassAt(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<LegacyContractClass | Omit<CompiledSierra, "sierra_program_debug_info">>;
3216
3758
  getCode(_contractAddress: string, _blockIdentifier?: BlockIdentifier): Promise<GetCodeResponse>;
3217
- getContractVersion(contractAddress: string, classHash?: undefined, options?: getContractVersionOptions): Promise<ContractVersion>;
3218
- getContractVersion(contractAddress: undefined, classHash: string, options?: getContractVersionOptions): Promise<ContractVersion>;
3759
+ getContractVersion(contractAddress: BigNumberish, classHash?: undefined, options?: getContractVersionOptions): Promise<ContractVersion>;
3760
+ getContractVersion(contractAddress: undefined, classHash: BigNumberish, options?: getContractVersionOptions): Promise<ContractVersion>;
3761
+ /**
3762
+ * @deprecated use get*type*EstimateFee (will be refactored based on type after sequencer deprecation)
3763
+ */
3219
3764
  getEstimateFee(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<EstimateFeeResponse>;
3220
3765
  getInvokeEstimateFee(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<EstimateFeeResponse>;
3221
3766
  getDeclareEstimateFee(invocation: DeclareContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<EstimateFeeResponse>;
3222
3767
  getDeployAccountEstimateFee(invocation: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<EstimateFeeResponse>;
3223
3768
  getEstimateFeeBulk(invocations: AccountInvocations, { blockIdentifier, skipValidate }: getEstimateFeeBulkOptions): Promise<EstimateFeeResponseBulk>;
3224
- declareContract({ contract, signature, senderAddress, compiledClassHash }: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<DeclareContractResponse>;
3225
- deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise<DeployContractResponse>;
3226
- invokeFunction(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise<InvokeFunctionResponse>;
3769
+ invokeFunction(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise<InvokedTransaction>;
3770
+ declareContract({ contract, signature, senderAddress, compiledClassHash }: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<DeclaredTransaction>;
3771
+ deployAccountContract({ classHash, constructorCalldata, addressSalt, signature }: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise<DeployedAccountTransaction>;
3227
3772
  callContract(call: Call, blockIdentifier?: BlockIdentifier): Promise<CallContractResponse>;
3228
- traceTransaction(transactionHash: TransactionHash): Promise<Trace>;
3229
- traceBlockTransactions(blockHash: BlockHash): Promise<Traces>;
3230
- waitForTransaction(txHash: string, options?: waitForTransactionOptions): Promise<any>;
3231
3773
  /**
3232
- * Gets the transaction count from a block.
3233
- *
3234
- *
3235
- * @param blockIdentifier
3236
- * @returns Number of transactions
3237
- */
3238
- getTransactionCount(blockIdentifier?: BlockIdentifier): Promise<GetTransactionCountResponse>;
3239
- /**
3240
- * Gets the latest block number
3241
- *
3242
- *
3243
- * @returns Number of the latest block
3774
+ * NEW: Estimate the fee for a message from L1
3775
+ * @param message Message From L1
3244
3776
  */
3245
- getBlockNumber(): Promise<GetBlockNumberResponse>;
3777
+ estimateMessageFee(message: L1Message, blockIdentifier?: BlockIdentifier): Promise<FEE_ESTIMATE>;
3246
3778
  /**
3247
- * Gets syncing status of the node
3248
- *
3249
- *
3779
+ * Returns an object about the sync status, or false if the node is not synching
3250
3780
  * @returns Object with the stats data
3251
3781
  */
3252
- getSyncingStats(): Promise<GetSyncingStatsResponse>;
3782
+ getSyncingStats(): Promise<Syncing>;
3253
3783
  /**
3254
- * Gets all the events filtered
3255
- *
3256
- *
3784
+ * Returns all events matching the given filter
3257
3785
  * @returns events and the pagination of the events
3258
3786
  */
3259
- getEvents(eventFilter: EventFilter): Promise<GetEventsResponse>;
3260
- getSimulateTransaction(invocations: AccountInvocations, { blockIdentifier, skipValidate, skipExecute, // @deprecated
3261
- skipFeeCharge, }: getSimulateTransactionOptions): Promise<SimulateTransactionResponse>;
3787
+ getEvents(eventFilter: EventFilter): Promise<EVENTS_CHUNK>;
3788
+ /**
3789
+ * StarknetId Endpoint (get name from address)
3790
+ */
3262
3791
  getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise<string>;
3792
+ /**
3793
+ * StarknetId Endpoint (get address from name)
3794
+ */
3263
3795
  getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string>;
3264
3796
  buildTransaction(invocation: AccountInvocationItem, versionType?: 'fee' | 'transaction'): BaseTransaction;
3265
3797
  }
@@ -4176,7 +4708,7 @@ declare namespace num {
4176
4708
 
4177
4709
  /**
4178
4710
  * Transforms a list of Calls, each with their own calldata, into
4179
- * two arrays: one with the entrypoints, and one with the concatenated calldata.
4711
+ * two arrays: one with the entry points, and one with the concatenated calldata
4180
4712
  */
4181
4713
  declare const transformCallsToMulticallArrays: (calls: Call[]) => {
4182
4714
  callArray: ParsedStruct[];
@@ -4452,7 +4984,7 @@ interface Context {
4452
4984
  */
4453
4985
  declare const getDependencies: (types: TypedData['types'], type: string, dependencies?: string[]) => string[];
4454
4986
  /**
4455
- * Encode a type to a string. All dependant types are alphabetically sorted.
4987
+ * Encode a type to a string. All dependent types are alphabetically sorted.
4456
4988
  */
4457
4989
  declare const encodeType: (types: TypedData['types'], type: string) => string;
4458
4990
  /**
@@ -4465,13 +4997,13 @@ declare const getTypeHash: (types: TypedData['types'], type: string) => string;
4465
4997
  */
4466
4998
  declare const encodeValue: (types: TypedData['types'], type: string, data: unknown, ctx?: Context) => [string, string];
4467
4999
  /**
4468
- * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values. All
4469
- * dependant types are automatically encoded.
5000
+ * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values.
5001
+ * All dependent types are automatically encoded.
4470
5002
  */
4471
5003
  declare const encodeData: <T extends TypedData>(types: T["types"], type: string, data: T["message"]) => string[][];
4472
5004
  /**
4473
- * Get encoded data as a hash. The data should be a key -> value object with all the required values. All dependant
4474
- * types are automatically encoded.
5005
+ * Get encoded data as a hash. The data should be a key -> value object with all the required values.
5006
+ * All dependent types are automatically encoded.
4475
5007
  */
4476
5008
  declare const getStructHash: <T extends TypedData>(types: T["types"], type: string, data: T["message"]) => string;
4477
5009
  /**
@@ -4827,4 +5359,4 @@ declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): {
4827
5359
  /** @deprecated prefer the 'num' naming */
4828
5360
  declare const number: typeof num;
4829
5361
 
4830
- export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, EventAbi, EventEntry, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Litteral, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RevertedTransactionReceiptResponse, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus$1 as TransactionExecutionStatus, TransactionFinalityStatus$1 as TransactionFinalityStatus, TransactionStatus, TransactionType$1 as TransactionType, Tupled, TypedContract, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$1 as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
5362
+ export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, EventAbi, EventEntry, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Litteral, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RevertedTransactionReceiptResponse, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus, TransactionFinalityStatus, TransactionStatus$1 as TransactionStatus, TransactionType, Tupled, TypedContract, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getDefaultNodeUrl, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$1 as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };