starknet 9.2.1 → 9.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [9.2.2](https://github.com/starknet-io/starknet.js/compare/v9.2.1...v9.2.2) (2025-12-17)
2
+
3
+ ### Bug Fixes
4
+
5
+ - optional type narrow: getEvents, getTransactionTrace, estimateMessageFee, getL1MessagesStatus ([a3b8115](https://github.com/starknet-io/starknet.js/commit/a3b8115391be2efbebcd074ac2f64aba7a6a5f81))
6
+
1
7
  ## [9.2.1](https://github.com/starknet-io/starknet.js/compare/v9.2.0...v9.2.1) (2025-12-11)
2
8
 
3
9
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as RPC from '@starknet-io/starknet-types-010';
2
2
  import { PAYMASTER_API, CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, PRE_CONFIRMED_BLOCK_WITH_TX_HASHES, BLOCK_WITH_TX_HASHES, IsType, OutsideExecutionTypedData, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, ETransactionVersion3 as ETransactionVersion3$1, TransactionHash, BlockHash, FAILED_TO_RECEIVE_TXN, NO_TRACE_AVAILABLE, CONTRACT_NOT_FOUND, ENTRYPOINT_NOT_FOUND, BLOCK_NOT_FOUND, INVALID_TXN_INDEX, CLASS_HASH_NOT_FOUND, TXN_HASH_NOT_FOUND, PAGE_SIZE_TOO_BIG, NO_BLOCKS, INVALID_CONTINUATION_TOKEN, TOO_MANY_KEYS_IN_FILTER, CONTRACT_ERROR, TRANSACTION_EXECUTION_ERROR, STORAGE_PROOF_NOT_SUPPORTED, CLASS_ALREADY_DECLARED, INVALID_TRANSACTION_NONCE, INSUFFICIENT_RESOURCES_FOR_VALIDATE, INSUFFICIENT_ACCOUNT_BALANCE, VALIDATION_FAILURE, COMPILATION_FAILED, CONTRACT_CLASS_SIZE_IS_TOO_LARGE, NON_ACCOUNT, DUPLICATE_TX, COMPILED_CLASS_HASH_MISMATCH, UNSUPPORTED_TX_VERSION, UNSUPPORTED_CONTRACT_CLASS_VERSION, UNEXPECTED_ERROR, REPLACEMENT_TRANSACTION_UNDERPRICED, FEE_BELOW_MINIMUM, INVALID_SUBSCRIPTION_ID, TOO_MANY_ADDRESSES_IN_FILTER, TOO_MANY_BLOCKS_BACK, COMPILATION_ERROR, ETransactionVersion as ETransactionVersion$1, SUBSCRIPTION_ID, TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1, TXN_STATUS_WITHOUT_L1, StarknetEventsEvent, TransactionsStatusEvent, NewTransactionReceiptsEvent, NewTransactionEvent, NewHeadsEvent, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, EDAMode as EDAMode$1, StarknetType, StarknetMerkleType, TypedDataRevision, OutsideCallV1, OutsideCallV2, EmittedEvent as EmittedEvent$1, Event as Event$2, Address, Permission, ChainId, AccountDeploymentData, AddInvokeTransactionParameters, AddInvokeTransactionResult, AddDeclareTransactionParameters, AddDeclareTransactionResult, SpecVersion } from '@starknet-io/starknet-types-010';
3
3
  export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-010';
4
- import * as RPC$1 from '@starknet-io/starknet-types-09';
4
+ import * as RPCSPEC09 from '@starknet-io/starknet-types-09';
5
5
  import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi';
6
6
  import * as weierstrass from '@noble/curves/abstract/weierstrass';
7
7
  import { RecoveredSignatureType } from '@noble/curves/abstract/weierstrass';
@@ -52,8 +52,9 @@ declare namespace jsonrpc {
52
52
  }
53
53
 
54
54
  declare const index$4_PAYMASTER_API: typeof PAYMASTER_API;
55
+ declare const index$4_RPCSPEC09: typeof RPCSPEC09;
55
56
  declare namespace index$4 {
56
- export { jsonrpc as JRPC, index$4_PAYMASTER_API as PAYMASTER_API, RPC as RPCSPEC010, RPC$1 as RPCSPEC09 };
57
+ export { jsonrpc as JRPC, index$4_PAYMASTER_API as PAYMASTER_API, RPC as RPCSPEC010, index$4_RPCSPEC09 as RPCSPEC09 };
57
58
  }
58
59
 
59
60
  type CairoEnumRaw = Record<string, any>;
@@ -463,7 +464,7 @@ type MergeProperties<T1 extends Record<any, any>, T2 extends Record<any, any>> =
463
464
  currently supported RPC specifications
464
465
  */
465
466
  type Merge<T1, T2> = Simplify<T1 extends Array<any> ? T2 extends Array<any> ? Array<Merge<ArrayElement<T1>, ArrayElement<T2>>> : T1 : T2 extends Array<any> ? T2 : T1 extends object ? T2 extends object ? MergeProperties<T1, T2> : T1 : T2 extends object ? T2 : T1 | T2>;
466
- type ETransactionVersion = RPC$1.ETransactionVersion;
467
+ type ETransactionVersion = RPCSPEC09.ETransactionVersion;
467
468
  declare const ETransactionVersion: {
468
469
  readonly V0: "0x0";
469
470
  readonly V1: "0x1";
@@ -474,7 +475,7 @@ declare const ETransactionVersion: {
474
475
  readonly F2: "0x100000000000000000000000000000002";
475
476
  readonly F3: "0x100000000000000000000000000000003";
476
477
  };
477
- type ETransactionVersion2 = RPC$1.ETransactionVersion2;
478
+ type ETransactionVersion2 = RPCSPEC09.ETransactionVersion2;
478
479
  declare const ETransactionVersion2: {
479
480
  readonly V0: "0x0";
480
481
  readonly V1: "0x1";
@@ -483,25 +484,25 @@ declare const ETransactionVersion2: {
483
484
  readonly F1: "0x100000000000000000000000000000001";
484
485
  readonly F2: "0x100000000000000000000000000000002";
485
486
  };
486
- type ETransactionVersion3 = RPC$1.ETransactionVersion3;
487
+ type ETransactionVersion3 = RPCSPEC09.ETransactionVersion3;
487
488
  declare const ETransactionVersion3: {
488
489
  readonly V3: "0x3";
489
490
  readonly F3: "0x100000000000000000000000000000003";
490
491
  };
491
- type BLOCK_HASH = Merge<RPC.BLOCK_HASH, RPC$1.BLOCK_HASH>;
492
- type BLOCK_NUMBER = Merge<RPC.BLOCK_NUMBER, RPC$1.BLOCK_NUMBER>;
493
- type FELT = Merge<RPC.FELT, RPC$1.FELT>;
494
- type TXN_HASH = Merge<RPC.TXN_HASH, RPC$1.TXN_HASH>;
495
- type PRICE_UNIT = Merge<RPC.PRICE_UNIT, RPC$1.PRICE_UNIT>;
496
- type RESOURCE_PRICE = Merge<RPC.RESOURCE_PRICE, RPC$1.RESOURCE_PRICE>;
497
- type SIMULATION_FLAG = Merge<RPC.SIMULATION_FLAG, RPC$1.SIMULATION_FLAG>;
498
- type STATE_UPDATE = Merge<RPC.STATE_UPDATE, RPC$1.STATE_UPDATE>;
499
- type PRE_CONFIRMED_STATE_UPDATE = Merge<RPC.PRE_CONFIRMED_STATE_UPDATE, RPC$1.PRE_CONFIRMED_STATE_UPDATE>;
500
- type BlockWithTxHashes = Merge<RPC.BlockWithTxHashes, RPC$1.BlockWithTxHashes>;
501
- type ContractClassPayload = Merge<RPC.ContractClass, RPC$1.ContractClass>;
502
- type DeclaredTransaction = Merge<RPC.DeclaredTransaction, RPC$1.DeclaredTransaction>;
503
- type InvokedTransaction = Merge<RPC.InvokedTransaction, RPC$1.InvokedTransaction>;
504
- type DeployedAccountTransaction = Merge<RPC.DeployedAccountTransaction, RPC$1.DeployedAccountTransaction>;
492
+ type BLOCK_HASH = Merge<RPC.BLOCK_HASH, RPCSPEC09.BLOCK_HASH>;
493
+ type BLOCK_NUMBER = Merge<RPC.BLOCK_NUMBER, RPCSPEC09.BLOCK_NUMBER>;
494
+ type FELT = Merge<RPC.FELT, RPCSPEC09.FELT>;
495
+ type TXN_HASH = Merge<RPC.TXN_HASH, RPCSPEC09.TXN_HASH>;
496
+ type PRICE_UNIT = Merge<RPC.PRICE_UNIT, RPCSPEC09.PRICE_UNIT>;
497
+ type RESOURCE_PRICE = Merge<RPC.RESOURCE_PRICE, RPCSPEC09.RESOURCE_PRICE>;
498
+ type SIMULATION_FLAG = Merge<RPC.SIMULATION_FLAG, RPCSPEC09.SIMULATION_FLAG>;
499
+ type STATE_UPDATE = Merge<RPC.STATE_UPDATE, RPCSPEC09.STATE_UPDATE>;
500
+ type PRE_CONFIRMED_STATE_UPDATE = Merge<RPC.PRE_CONFIRMED_STATE_UPDATE, RPCSPEC09.PRE_CONFIRMED_STATE_UPDATE>;
501
+ type BlockWithTxHashes = Merge<RPC.BlockWithTxHashes, RPCSPEC09.BlockWithTxHashes>;
502
+ type ContractClassPayload = Merge<RPC.ContractClass, RPCSPEC09.ContractClass>;
503
+ type DeclaredTransaction = Merge<RPC.DeclaredTransaction, RPCSPEC09.DeclaredTransaction>;
504
+ type InvokedTransaction = Merge<RPC.InvokedTransaction, RPCSPEC09.InvokedTransaction>;
505
+ type DeployedAccountTransaction = Merge<RPC.DeployedAccountTransaction, RPCSPEC09.DeployedAccountTransaction>;
505
506
  type L1_HANDLER_TXN = RPC.L1_HANDLER_TXN;
506
507
  type EDataAvailabilityMode = RPC.EDataAvailabilityMode;
507
508
  declare const EDataAvailabilityMode: {
@@ -513,18 +514,18 @@ declare const EDAMode: {
513
514
  readonly L1: 0;
514
515
  readonly L2: 1;
515
516
  };
516
- type EmittedEvent = Merge<RPC.EmittedEvent, RPC$1.EmittedEvent>;
517
- type Event$1 = Merge<RPC.Event, RPC$1.Event>;
518
- type Receipt = Merge<RPC.TransactionReceiptProductionBlock, RPC$1.TransactionReceiptProductionBlock>;
517
+ type EmittedEvent = Merge<RPC.EmittedEvent, RPCSPEC09.EmittedEvent>;
518
+ type Event$1 = Merge<RPC.Event, RPCSPEC09.Event>;
519
+ type Receipt = Merge<RPC.TransactionReceiptProductionBlock, RPCSPEC09.TransactionReceiptProductionBlock>;
519
520
  /**
520
521
  * original response from estimate fee without parsing
521
522
  */
522
- type FeeEstimate = Merge<RPC.FEE_ESTIMATE, RPC$1.FEE_ESTIMATE>;
523
+ type FeeEstimate = Merge<RPC.FEE_ESTIMATE, RPCSPEC09.FEE_ESTIMATE>;
523
524
  type ApiEstimateFeeResponse = FeeEstimate[];
524
525
  declare function isRPC08Plus_ResourceBounds(entry: ResourceBounds): entry is RPC.ResourceBounds;
525
526
  declare function isRPC08Plus_ResourceBoundsBN(entry: ResourceBoundsBN): entry is ResourceBoundsBN;
526
- type ResourceBounds = Merge<RPC.ResourceBounds, RPC$1.ResourceBounds>;
527
- type EventFilter = RPC$1.EventFilter;
527
+ type ResourceBounds = Merge<RPC.ResourceBounds, RPCSPEC09.ResourceBounds>;
528
+ type EventFilter = RPCSPEC09.EventFilter;
528
529
  /**
529
530
  * Represents percentage overhead for each resource bound
530
531
  * numerical 50 means 50% overhead
@@ -542,15 +543,15 @@ type ResourceBoundsBN = {
542
543
  [P in keyof ResourceBounds[K]]: bigint;
543
544
  } : number;
544
545
  };
545
- type SimulateTransaction = SimpleOneOf<RPC$1.SimulateTransaction, RPC.SimulateTransaction>;
546
- type SimulateTransactionResponse = SimpleOneOf<RPC$1.SimulateTransactionResponse, RPC.SimulateTransactionResponse>;
547
- type TransactionTrace = SimpleOneOf<RPC$1.TRANSACTION_TRACE, RPC.TRANSACTION_TRACE>;
548
- type TransactionWithHash = Merge<RPC.TransactionWithHash, RPC$1.TransactionWithHash>;
549
- type TransactionReceipt = Merge<RPC.TransactionReceipt, RPC$1.TransactionReceipt>;
546
+ type SimulateTransaction = SimpleOneOf<RPCSPEC09.SimulateTransaction, RPC.SimulateTransaction>;
547
+ type SimulateTransactionResponse = SimpleOneOf<RPCSPEC09.SimulateTransactionResponse, RPC.SimulateTransactionResponse>;
548
+ type TransactionTrace = SimpleOneOf<RPCSPEC09.TRANSACTION_TRACE, RPC.TRANSACTION_TRACE>;
549
+ type TransactionWithHash = Merge<RPC.TransactionWithHash, RPCSPEC09.TransactionWithHash>;
550
+ type TransactionReceipt = Merge<RPC.TransactionReceipt, RPCSPEC09.TransactionReceipt>;
550
551
  type Methods = RPC.Methods;
551
- type TXN_STATUS = Merge<RPC.TXN_STATUS, RPC$1.TXN_STATUS>;
552
- type TXN_EXECUTION_STATUS = Merge<RPC.TXN_EXECUTION_STATUS, RPC$1.TXN_EXECUTION_STATUS>;
553
- type TransactionStatus = Merge<RPC.TransactionStatus, RPC$1.TransactionStatus>;
552
+ type TXN_STATUS = Merge<RPC.TXN_STATUS, RPCSPEC09.TXN_STATUS>;
553
+ type TXN_EXECUTION_STATUS = Merge<RPC.TXN_EXECUTION_STATUS, RPCSPEC09.TXN_EXECUTION_STATUS>;
554
+ type TransactionStatus = Merge<RPC.TransactionStatus, RPCSPEC09.TransactionStatus>;
554
555
  type ETransactionStatus = RPC.ETransactionStatus;
555
556
  declare const ETransactionStatus: {
556
557
  readonly RECEIVED: "RECEIVED";
@@ -564,9 +565,9 @@ declare const ETransactionExecutionStatus: {
564
565
  readonly SUCCEEDED: "SUCCEEDED";
565
566
  readonly REVERTED: "REVERTED";
566
567
  };
567
- type FEE_ESTIMATE = Merge<RPC.FEE_ESTIMATE, RPC$1.FEE_ESTIMATE>;
568
- type EVENTS_CHUNK = Merge<RPC.EVENTS_CHUNK, RPC$1.EVENTS_CHUNK>;
569
- type TransactionType = RPC$1.ETransactionType;
568
+ type FEE_ESTIMATE = Merge<RPC.FEE_ESTIMATE, RPCSPEC09.FEE_ESTIMATE>;
569
+ type EVENTS_CHUNK = Merge<RPC.EVENTS_CHUNK, RPCSPEC09.EVENTS_CHUNK>;
570
+ type TransactionType = RPCSPEC09.ETransactionType;
570
571
  declare const TransactionType: {
571
572
  readonly DECLARE: "DECLARE";
572
573
  readonly DEPLOY: "DEPLOY";
@@ -574,24 +575,24 @@ declare const TransactionType: {
574
575
  readonly INVOKE: "INVOKE";
575
576
  readonly L1_HANDLER: "L1_HANDLER";
576
577
  };
577
- type BlockStatus = RPC$1.EBlockStatus;
578
+ type BlockStatus = RPCSPEC09.EBlockStatus;
578
579
  declare const BlockStatus: {
579
580
  readonly PRE_CONFIRMED: "PRE_CONFIRMED";
580
581
  readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2";
581
582
  readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1";
582
583
  };
583
- type TransactionFinalityStatus = RPC$1.ETransactionFinalityStatus;
584
+ type TransactionFinalityStatus = RPCSPEC09.ETransactionFinalityStatus;
584
585
  declare const TransactionFinalityStatus: {
585
586
  readonly PRE_CONFIRMED: "PRE_CONFIRMED";
586
587
  readonly ACCEPTED_ON_L2: "ACCEPTED_ON_L2";
587
588
  readonly ACCEPTED_ON_L1: "ACCEPTED_ON_L1";
588
589
  };
589
- type TransactionExecutionStatus = RPC$1.ETransactionExecutionStatus;
590
+ type TransactionExecutionStatus = RPCSPEC09.ETransactionExecutionStatus;
590
591
  declare const TransactionExecutionStatus: {
591
592
  readonly SUCCEEDED: "SUCCEEDED";
592
593
  readonly REVERTED: "REVERTED";
593
594
  };
594
- type BlockTag = RPC$1.EBlockTag;
595
+ type BlockTag = RPCSPEC09.EBlockTag;
595
596
  declare const BlockTag: {
596
597
  readonly LATEST: "latest";
597
598
  readonly PRE_CONFIRMED: "pre_confirmed";
@@ -2174,7 +2175,7 @@ declare abstract class ProviderInterface {
2174
2175
  * @param txHash - transaction hash
2175
2176
  * @returns Transaction trace
2176
2177
  */
2177
- abstract getTransactionTrace(txHash: BigNumberish): Promise<RPC.TRANSACTION_TRACE | RPC$1.TRANSACTION_TRACE>;
2178
+ abstract getTransactionTrace(txHash: BigNumberish): Promise<RPC.TRANSACTION_TRACE | RPCSPEC09.TRANSACTION_TRACE>;
2178
2179
  /**
2179
2180
  * Get the status of a transaction
2180
2181
  * @param transactionHash - transaction hash
@@ -2217,7 +2218,7 @@ declare abstract class ProviderInterface {
2217
2218
  * @param blockIdentifier - block identifier
2218
2219
  * @returns Fee estimate
2219
2220
  */
2220
- abstract estimateMessageFee(message: RPC$1.L1Message, blockIdentifier?: BlockIdentifier): Promise<RPC.FEE_ESTIMATE | RPC$1.MESSAGE_FEE_ESTIMATE>;
2221
+ abstract estimateMessageFee(message: RPCSPEC09.L1Message, blockIdentifier?: BlockIdentifier): Promise<RPC.FEE_ESTIMATE | RPCSPEC09.MESSAGE_FEE_ESTIMATE>;
2221
2222
  /**
2222
2223
  * Get node synchronization status
2223
2224
  * @returns Sync status or false if not syncing
@@ -2228,7 +2229,7 @@ declare abstract class ProviderInterface {
2228
2229
  * @param eventFilter - event filter
2229
2230
  * @returns Events and pagination info
2230
2231
  */
2231
- abstract getEvents(eventFilter: RPC.EventFilter | RPC$1.EventFilter): Promise<RPC.EVENTS_CHUNK | RPC$1.EVENTS_CHUNK>;
2232
+ abstract getEvents(eventFilter: RPC.EventFilter | RPCSPEC09.EventFilter): Promise<RPC.EVENTS_CHUNK | RPCSPEC09.EVENTS_CHUNK>;
2232
2233
  /**
2233
2234
  * Verify in Starknet a signature of a TypedData object or of a given hash.
2234
2235
  * @param {BigNumberish | TypedData} message TypedData object to be verified, or message hash to be verified.
@@ -2270,7 +2271,7 @@ declare abstract class ProviderInterface {
2270
2271
  * @param transactionHash - L1 transaction hash
2271
2272
  * @returns L1 message status
2272
2273
  */
2273
- abstract getL1MessagesStatus(transactionHash: BigNumberish): Promise<RPC.L1L2MessagesStatus | RPC$1.L1L2MessagesStatus>;
2274
+ abstract getL1MessagesStatus(transactionHash: BigNumberish): Promise<RPC.L1L2MessagesStatus | RPCSPEC09.L1L2MessagesStatus>;
2274
2275
  /**
2275
2276
  * Get Merkle paths in state tries
2276
2277
  * @param classHashes - class hashes
@@ -4024,7 +4025,7 @@ declare class RpcChannel$1 {
4024
4025
  setChainId(chainId: _StarknetChainId): void;
4025
4026
  fetch(method: string, params?: object, id?: string | number): Promise<Response>;
4026
4027
  protected errorHandler(method: string, params: any, rpcError?: Error$1, otherError?: any): void;
4027
- protected fetchEndpoint<T extends keyof RPC$1.Methods>(method: T, params?: RPC$1.Methods[T]['params']): Promise<RPC$1.Methods[T]['result']>;
4028
+ protected fetchEndpoint<T extends keyof RPCSPEC09.Methods>(method: T, params?: RPCSPEC09.Methods[T]['params']): Promise<RPCSPEC09.Methods[T]['result']>;
4028
4029
  getChainId(): Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">;
4029
4030
  /**
4030
4031
  * fetch rpc node specVersion
@@ -4039,10 +4040,10 @@ declare class RpcChannel$1 {
4039
4040
  /**
4040
4041
  * Given an l1 tx hash, returns the associated l1_handler tx hashes and statuses for all L1 -> L2 messages sent by the l1 transaction, ordered by the l1 tx sending order
4041
4042
  */
4042
- getMessagesStatus(txHash: BigNumberish): Promise<RPC$1.L1L2MessagesStatus>;
4043
- getStorageProof(classHashes?: BigNumberish[], contractAddresses?: BigNumberish[], contractsStorageKeys?: RPC$1.CONTRACT_STORAGE_KEYS[], // TODO: allow BigNUmberish[] and fix formatting before request
4044
- blockIdentifier?: BlockIdentifier): Promise<RPC$1.StorageProof>;
4045
- getCompiledCasm(classHash: BigNumberish): Promise<RPC$1.CASM_COMPILED_CONTRACT_CLASS>;
4043
+ getMessagesStatus(txHash: BigNumberish): Promise<RPCSPEC09.L1L2MessagesStatus>;
4044
+ getStorageProof(classHashes?: BigNumberish[], contractAddresses?: BigNumberish[], contractsStorageKeys?: RPCSPEC09.CONTRACT_STORAGE_KEYS[], // TODO: allow BigNUmberish[] and fix formatting before request
4045
+ blockIdentifier?: BlockIdentifier): Promise<RPCSPEC09.StorageProof>;
4046
+ getCompiledCasm(classHash: BigNumberish): Promise<RPCSPEC09.CASM_COMPILED_CONTRACT_CLASS>;
4046
4047
  getNonceForAddress(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<string>;
4047
4048
  /**
4048
4049
  * Helper method to get the starknet version from the block, default latest block
@@ -4052,7 +4053,7 @@ declare class RpcChannel$1 {
4052
4053
  /**
4053
4054
  * Get the most recent accepted block hash and number
4054
4055
  */
4055
- getBlockLatestAccepted(): Promise<RPC$1.BlockHashAndNumber>;
4056
+ getBlockLatestAccepted(): Promise<RPCSPEC09.BlockHashAndNumber>;
4056
4057
  /**
4057
4058
  * Get the most recent accepted block number
4058
4059
  * redundant use getBlockLatestAccepted();
@@ -4060,42 +4061,42 @@ declare class RpcChannel$1 {
4060
4061
  */
4061
4062
  getBlockNumber(): Promise<number>;
4062
4063
  getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise<({
4063
- status: RPC$1.BLOCK_STATUS;
4064
- } & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_TX_HASHES & {}) | (RPC$1.BLOCK_BODY_WITH_TX_HASHES & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
4064
+ status: RPCSPEC09.BLOCK_STATUS;
4065
+ } & RPCSPEC09.BLOCK_HEADER & RPCSPEC09.BLOCK_BODY_WITH_TX_HASHES & {}) | (RPCSPEC09.BLOCK_BODY_WITH_TX_HASHES & RPCSPEC09.PRE_CONFIRMED_BLOCK_HEADER & {
4065
4066
  block_hash?: undefined;
4066
4067
  new_root?: undefined;
4067
4068
  status?: undefined;
4068
4069
  parent_hash?: undefined;
4069
4070
  })>;
4070
4071
  getBlockWithTxs(blockIdentifier?: BlockIdentifier): Promise<({
4071
- status: RPC$1.BLOCK_STATUS;
4072
- } & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_TXS & {}) | (RPC$1.BLOCK_BODY_WITH_TXS & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
4072
+ status: RPCSPEC09.BLOCK_STATUS;
4073
+ } & RPCSPEC09.BLOCK_HEADER & RPCSPEC09.BLOCK_BODY_WITH_TXS & {}) | (RPCSPEC09.BLOCK_BODY_WITH_TXS & RPCSPEC09.PRE_CONFIRMED_BLOCK_HEADER & {
4073
4074
  block_hash?: undefined;
4074
4075
  new_root?: undefined;
4075
4076
  status?: undefined;
4076
4077
  parent_hash?: undefined;
4077
4078
  })>;
4078
4079
  getBlockWithReceipts(blockIdentifier?: BlockIdentifier): Promise<({
4079
- status: RPC$1.BLOCK_STATUS;
4080
- } & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_RECEIPTS & {}) | (RPC$1.BLOCK_BODY_WITH_RECEIPTS & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
4080
+ status: RPCSPEC09.BLOCK_STATUS;
4081
+ } & RPCSPEC09.BLOCK_HEADER & RPCSPEC09.BLOCK_BODY_WITH_RECEIPTS & {}) | (RPCSPEC09.BLOCK_BODY_WITH_RECEIPTS & RPCSPEC09.PRE_CONFIRMED_BLOCK_HEADER & {
4081
4082
  block_hash?: undefined;
4082
4083
  new_root?: undefined;
4083
4084
  status?: undefined;
4084
4085
  parent_hash?: undefined;
4085
4086
  })>;
4086
- getBlockStateUpdate(blockIdentifier?: BlockIdentifier): Promise<(RPC$1.STATE_UPDATE & {}) | (RPC$1.PRE_CONFIRMED_STATE_UPDATE & {
4087
+ getBlockStateUpdate(blockIdentifier?: BlockIdentifier): Promise<(RPCSPEC09.STATE_UPDATE & {}) | (RPCSPEC09.PRE_CONFIRMED_STATE_UPDATE & {
4087
4088
  new_root?: undefined;
4088
4089
  })>;
4089
- getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<RPC$1.BlockTransactionsTraces>;
4090
+ getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<RPCSPEC09.BlockTransactionsTraces>;
4090
4091
  getBlockTransactionCount(blockIdentifier?: BlockIdentifier): Promise<number>;
4091
- getTransactionByHash(txHash: BigNumberish): Promise<RPC$1.TXN_WITH_HASH>;
4092
- getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<RPC$1.TXN_WITH_HASH>;
4093
- getTransactionReceipt(txHash: BigNumberish): Promise<RPC$1.TXN_RECEIPT_WITH_BLOCK_INFO>;
4094
- getTransactionTrace(txHash: BigNumberish): Promise<RPC$1.TRANSACTION_TRACE>;
4092
+ getTransactionByHash(txHash: BigNumberish): Promise<RPCSPEC09.TXN_WITH_HASH>;
4093
+ getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<RPCSPEC09.TXN_WITH_HASH>;
4094
+ getTransactionReceipt(txHash: BigNumberish): Promise<RPCSPEC09.TXN_RECEIPT_WITH_BLOCK_INFO>;
4095
+ getTransactionTrace(txHash: BigNumberish): Promise<RPCSPEC09.TRANSACTION_TRACE>;
4095
4096
  /**
4096
4097
  * Get the status of a transaction
4097
4098
  */
4098
- getTransactionStatus(transactionHash: BigNumberish): Promise<RPC$1.TXN_STATUS_RESULT>;
4099
+ getTransactionStatus(transactionHash: BigNumberish): Promise<RPCSPEC09.TXN_STATUS_RESULT>;
4099
4100
  /**
4100
4101
  * @param invocations AccountInvocations
4101
4102
  * @param simulateTransactionOptions blockIdentifier and flags to skip validation and fee charge<br/>
@@ -4103,50 +4104,50 @@ declare class RpcChannel$1 {
4103
4104
  * - skipValidate (default true)<br/>
4104
4105
  * - skipFeeCharge (default true)<br/>
4105
4106
  */
4106
- simulateTransaction(invocations: AccountInvocations, simulateTransactionOptions?: getSimulateTransactionOptions): Promise<RPC$1.SimulateTransactionResponse>;
4107
- waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise<RPC$1.TXN_RECEIPT>;
4107
+ simulateTransaction(invocations: AccountInvocations, simulateTransactionOptions?: getSimulateTransactionOptions): Promise<RPCSPEC09.SimulateTransactionResponse>;
4108
+ waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise<RPCSPEC09.TXN_RECEIPT>;
4108
4109
  fastWaitForTransaction(txHash: BigNumberish, address: string, initNonceBN: BigNumberish, options?: fastWaitForTransactionOptions): Promise<boolean>;
4109
4110
  getStorageAt(contractAddress: BigNumberish, key: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<string>;
4110
4111
  getClassHashAt(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<string>;
4111
- getClass(classHash: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<(RPC$1.CONTRACT_CLASS & {
4112
+ getClass(classHash: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<(RPCSPEC09.CONTRACT_CLASS & {
4112
4113
  program?: undefined;
4113
- }) | (RPC$1.DEPRECATED_CONTRACT_CLASS & {
4114
+ }) | (RPCSPEC09.DEPRECATED_CONTRACT_CLASS & {
4114
4115
  sierra_program?: undefined;
4115
4116
  contract_class_version?: undefined;
4116
4117
  })>;
4117
- getClassAt(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<(RPC$1.CONTRACT_CLASS & {
4118
+ getClassAt(contractAddress: BigNumberish, blockIdentifier?: BlockIdentifier): Promise<(RPCSPEC09.CONTRACT_CLASS & {
4118
4119
  program?: undefined;
4119
- }) | (RPC$1.DEPRECATED_CONTRACT_CLASS & {
4120
+ }) | (RPCSPEC09.DEPRECATED_CONTRACT_CLASS & {
4120
4121
  sierra_program?: undefined;
4121
4122
  contract_class_version?: undefined;
4122
4123
  })>;
4123
- getEstimateFee(invocations: AccountInvocations, options?: getEstimateFeeBulkOptions): Promise<RPC$1.FEE_ESTIMATE[]>;
4124
- invoke(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise<RPC$1.InvokedTransaction>;
4125
- declare(declareTransaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPC$1.DeclaredTransaction | RPC$1.TXN_RECEIPT>;
4126
- deployAccount(deployAccountTransaction: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPC$1.DeployedAccountTransaction | RPC$1.TXN_RECEIPT>;
4124
+ getEstimateFee(invocations: AccountInvocations, options?: getEstimateFeeBulkOptions): Promise<RPCSPEC09.FEE_ESTIMATE[]>;
4125
+ invoke(functionInvocation: Invocation, details: InvocationsDetailsWithNonce): Promise<RPCSPEC09.InvokedTransaction>;
4126
+ declare(declareTransaction: DeclareContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPCSPEC09.DeclaredTransaction | RPCSPEC09.TXN_RECEIPT>;
4127
+ deployAccount(deployAccountTransaction: DeployAccountContractTransaction, details: InvocationsDetailsWithNonce): Promise<RPCSPEC09.DeployedAccountTransaction | RPCSPEC09.TXN_RECEIPT>;
4127
4128
  callContract(call: Call, blockIdentifier?: BlockIdentifier): Promise<string[]>;
4128
4129
  /**
4129
4130
  * NEW: Estimate the fee for a message from L1
4130
4131
  * @param message Message From L1
4131
4132
  */
4132
- estimateMessageFee(message: RPC$1.L1Message, blockIdentifier?: BlockIdentifier): Promise<RPC$1.MESSAGE_FEE_ESTIMATE>;
4133
+ estimateMessageFee(message: RPCSPEC09.L1Message, blockIdentifier?: BlockIdentifier): Promise<RPCSPEC09.MESSAGE_FEE_ESTIMATE>;
4133
4134
  /**
4134
4135
  * Returns an object about the sync status, or false if the node is not synching
4135
4136
  * @returns Object with the stats data
4136
4137
  */
4137
- getSyncingStats(): Promise<RPC$1.Syncing>;
4138
+ getSyncingStats(): Promise<RPCSPEC09.Syncing>;
4138
4139
  /**
4139
4140
  * Returns all events matching the given filter
4140
4141
  * @returns events and the pagination of the events
4141
4142
  */
4142
- getEvents(eventFilter: RPC$1.EventFilter): Promise<RPC$1.EVENTS_CHUNK>;
4143
+ getEvents(eventFilter: RPCSPEC09.EventFilter): Promise<RPCSPEC09.EVENTS_CHUNK>;
4143
4144
  buildTransaction<T extends AccountInvocationItem>(invocation: T, versionType?: 'fee' | 'transaction'): T extends {
4144
4145
  type: typeof ETransactionType.INVOKE;
4145
- } ? RPC$1.INVOKE_TXN_V3 : T extends {
4146
+ } ? RPCSPEC09.INVOKE_TXN_V3 : T extends {
4146
4147
  type: typeof ETransactionType.DECLARE;
4147
- } ? RPC$1.BROADCASTED_DECLARE_TXN_V3 : T extends {
4148
+ } ? RPCSPEC09.BROADCASTED_DECLARE_TXN_V3 : T extends {
4148
4149
  type: typeof ETransactionType.DEPLOY_ACCOUNT;
4149
- } ? RPC$1.DEPLOY_ACCOUNT_TXN_V3 : never;
4150
+ } ? RPCSPEC09.DEPLOY_ACCOUNT_TXN_V3 : never;
4150
4151
  }
4151
4152
 
4152
4153
  declare namespace rpc_0_9_0 {
@@ -4774,19 +4775,19 @@ declare class RpcProvider$1 implements ProviderInterface {
4774
4775
  getBlock(blockIdentifier: 'pre_confirmed'): Promise<PreConfirmedBlock>;
4775
4776
  getBlock(blockIdentifier: 'latest'): Promise<Block$1>;
4776
4777
  getBlock(blockIdentifier: BlockIdentifier): Promise<GetBlockResponse>;
4777
- getBlockLatestAccepted(): Promise<RPC$1.BlockHashAndNumber>;
4778
+ getBlockLatestAccepted(): Promise<RPCSPEC09.BlockHashAndNumber>;
4778
4779
  getBlockNumber(): Promise<number>;
4779
4780
  getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise<({
4780
- status: RPC$1.BLOCK_STATUS;
4781
- } & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_TX_HASHES & {}) | (RPC$1.BLOCK_BODY_WITH_TX_HASHES & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
4781
+ status: RPCSPEC09.BLOCK_STATUS;
4782
+ } & RPCSPEC09.BLOCK_HEADER & RPCSPEC09.BLOCK_BODY_WITH_TX_HASHES & {}) | (RPCSPEC09.BLOCK_BODY_WITH_TX_HASHES & RPCSPEC09.PRE_CONFIRMED_BLOCK_HEADER & {
4782
4783
  block_hash?: undefined;
4783
4784
  new_root?: undefined;
4784
4785
  status?: undefined;
4785
4786
  parent_hash?: undefined;
4786
4787
  })>;
4787
4788
  getBlockWithTxs(blockIdentifier?: BlockIdentifier): Promise<({
4788
- status: RPC$1.BLOCK_STATUS;
4789
- } & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_TXS & {}) | (RPC$1.BLOCK_BODY_WITH_TXS & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
4789
+ status: RPCSPEC09.BLOCK_STATUS;
4790
+ } & RPCSPEC09.BLOCK_HEADER & RPCSPEC09.BLOCK_BODY_WITH_TXS & {}) | (RPCSPEC09.BLOCK_BODY_WITH_TXS & RPCSPEC09.PRE_CONFIRMED_BLOCK_HEADER & {
4790
4791
  block_hash?: undefined;
4791
4792
  new_root?: undefined;
4792
4793
  status?: undefined;
@@ -4807,8 +4808,8 @@ declare class RpcProvider$1 implements ProviderInterface {
4807
4808
  getGasPrices(blockIdentifier?: BlockIdentifier): Promise<GasPrices>;
4808
4809
  getL1MessageHash(l2TxHash: BigNumberish): Promise<string>;
4809
4810
  getBlockWithReceipts(blockIdentifier?: BlockIdentifier): Promise<({
4810
- status: RPC$1.BLOCK_STATUS;
4811
- } & RPC$1.BLOCK_HEADER & RPC$1.BLOCK_BODY_WITH_RECEIPTS & {}) | (RPC$1.BLOCK_BODY_WITH_RECEIPTS & RPC$1.PRE_CONFIRMED_BLOCK_HEADER & {
4811
+ status: RPCSPEC09.BLOCK_STATUS;
4812
+ } & RPCSPEC09.BLOCK_HEADER & RPCSPEC09.BLOCK_BODY_WITH_RECEIPTS & {}) | (RPCSPEC09.BLOCK_BODY_WITH_RECEIPTS & RPCSPEC09.PRE_CONFIRMED_BLOCK_HEADER & {
4812
4813
  block_hash?: undefined;
4813
4814
  new_root?: undefined;
4814
4815
  status?: undefined;
@@ -4824,14 +4825,15 @@ declare class RpcProvider$1 implements ProviderInterface {
4824
4825
  getBlockStateUpdate(blockIdentifier: 'pre_confirmed'): Promise<PreConfirmedStateUpdate>;
4825
4826
  getBlockStateUpdate(blockIdentifier: 'latest'): Promise<StateUpdate>;
4826
4827
  getBlockStateUpdate(blockIdentifier?: BlockIdentifier): Promise<StateUpdateResponse>;
4827
- getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<RPC$1.BlockTransactionsTraces>;
4828
+ getBlockTransactionsTraces(blockIdentifier?: BlockIdentifier): Promise<RPCSPEC09.BlockTransactionsTraces>;
4828
4829
  getBlockTransactionCount(blockIdentifier?: BlockIdentifier): Promise<number>;
4829
- getTransaction(txHash: BigNumberish): Promise<RPC$1.TXN_WITH_HASH>;
4830
- getTransactionByHash(txHash: BigNumberish): Promise<RPC$1.TXN_WITH_HASH>;
4831
- getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<RPC$1.TXN_WITH_HASH>;
4830
+ getTransaction(txHash: BigNumberish): Promise<RPCSPEC09.TXN_WITH_HASH>;
4831
+ getTransactionByHash(txHash: BigNumberish): Promise<RPCSPEC09.TXN_WITH_HASH>;
4832
+ getTransactionByBlockIdAndIndex(blockIdentifier: BlockIdentifier, index: number): Promise<RPCSPEC09.TXN_WITH_HASH>;
4832
4833
  getTransactionReceipt(txHash: BigNumberish): Promise<GetTransactionReceiptResponse>;
4833
- getTransactionTrace(txHash: BigNumberish): Promise<RPC.TRANSACTION_TRACE | RPC$1.TRANSACTION_TRACE>;
4834
- getTransactionStatus(transactionHash: BigNumberish): Promise<RPC$1.TXN_STATUS_RESULT>;
4834
+ getTransactionTrace<V extends _SupportedRpcVersion = _SupportedRpcVersion>(txHash: BigNumberish): Promise<V extends '0.10.0' ? RPC.TRANSACTION_TRACE : RPCSPEC09.TRANSACTION_TRACE>;
4835
+ getTransactionTrace(txHash: BigNumberish): Promise<RPC.TRANSACTION_TRACE | RPCSPEC09.TRANSACTION_TRACE>;
4836
+ getTransactionStatus(transactionHash: BigNumberish): Promise<RPCSPEC09.TXN_STATUS_RESULT>;
4835
4837
  getSimulateTransaction(invocations: AccountInvocations, options?: getSimulateTransactionOptions): Promise<SimulateTransactionOverheadResponse>;
4836
4838
  waitForTransaction(txHash: BigNumberish, options?: waitForTransactionOptions): Promise<GetTransactionReceiptResponse>;
4837
4839
  /**
@@ -4871,10 +4873,11 @@ declare class RpcProvider$1 implements ProviderInterface {
4871
4873
  transaction_hash: string;
4872
4874
  }>;
4873
4875
  callContract(call: Call, blockIdentifier?: BlockIdentifier): Promise<string[]>;
4874
- estimateMessageFee(message: RPC$1.L1Message, // same as spec08.L1Message
4875
- blockIdentifier?: BlockIdentifier): Promise<RPC.FEE_ESTIMATE | RPC$1.MESSAGE_FEE_ESTIMATE>;
4876
- getSyncingStats(): Promise<RPC$1.Syncing>;
4877
- getEvents(eventFilter: RPC.EventFilter | RPC$1.EventFilter): Promise<RPC.EVENTS_CHUNK | RPC$1.EVENTS_CHUNK>;
4876
+ estimateMessageFee<V extends _SupportedRpcVersion = _SupportedRpcVersion>(message: RPCSPEC09.L1Message, blockIdentifier?: BlockIdentifier): Promise<V extends '0.10.0' ? RPC.FEE_ESTIMATE : RPCSPEC09.MESSAGE_FEE_ESTIMATE>;
4877
+ estimateMessageFee(message: RPCSPEC09.L1Message, blockIdentifier?: BlockIdentifier): Promise<RPC.FEE_ESTIMATE | RPCSPEC09.MESSAGE_FEE_ESTIMATE>;
4878
+ getSyncingStats(): Promise<RPCSPEC09.Syncing>;
4879
+ getEvents<V extends _SupportedRpcVersion = _SupportedRpcVersion>(eventFilter: V extends '0.10.0' ? RPC.EventFilter : RPCSPEC09.EventFilter): Promise<V extends '0.10.0' ? RPC.EVENTS_CHUNK : RPCSPEC09.EVENTS_CHUNK>;
4880
+ getEvents(eventFilter: RPC.EventFilter | RPCSPEC09.EventFilter): Promise<RPC.EVENTS_CHUNK | RPCSPEC09.EVENTS_CHUNK>;
4878
4881
  verifyMessageInStarknet(message: BigNumberish | TypedData, signature: Signature, accountAddress: BigNumberish, signatureVerificationFunctionName?: string, signatureVerificationResponse?: {
4879
4882
  okResponse: string[];
4880
4883
  nokResponse: string[];
@@ -4882,7 +4885,8 @@ declare class RpcProvider$1 implements ProviderInterface {
4882
4885
  }): Promise<boolean>;
4883
4886
  isClassDeclared(contractClassIdentifier: ContractClassIdentifier, blockIdentifier?: BlockIdentifier): Promise<boolean>;
4884
4887
  prepareInvocations(invocations: Invocations): Promise<Invocations>;
4885
- getL1MessagesStatus(transactionHash: BigNumberish): Promise<RPC.L1L2MessagesStatus | RPC$1.L1L2MessagesStatus>;
4888
+ getL1MessagesStatus<V extends _SupportedRpcVersion = _SupportedRpcVersion>(transactionHash: BigNumberish): Promise<V extends '0.10.0' ? RPC.L1L2MessagesStatus : RPCSPEC09.L1L2MessagesStatus>;
4889
+ getL1MessagesStatus(transactionHash: BigNumberish): Promise<RPC.L1L2MessagesStatus | RPCSPEC09.L1L2MessagesStatus>;
4886
4890
  getStorageProof(classHashes: BigNumberish[], contractAddresses: BigNumberish[], contractsStorageKeys: CONTRACT_STORAGE_KEYS[], blockIdentifier?: BlockIdentifier): Promise<StorageProof>;
4887
4891
  getCompiledCasm(classHash: BigNumberish): Promise<CASM_COMPILED_CONTRACT_CLASS>;
4888
4892
  getEstimateTip(blockIdentifier?: BlockIdentifier, options?: TipAnalysisOptions): Promise<TipEstimate>;