starknet 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # [8.3.0](https://github.com/starknet-io/starknet.js/compare/v8.2.0...v8.3.0) (2025-08-15)
2
+
3
+ ### Features
4
+
5
+ - implement websocket 0.9 ([#1467](https://github.com/starknet-io/starknet.js/issues/1467)) ([7e988c4](https://github.com/starknet-io/starknet.js/commit/7e988c417ac2b4c862dc438b56a149ba7c20439d))
6
+
1
7
  # [8.2.0](https://github.com/starknet-io/starknet.js/compare/v8.1.2...v8.2.0) (2025-08-15)
2
8
 
3
9
  ### Features
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as RPC from '@starknet-io/starknet-types-09';
2
- import { CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_TAG, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, BLOCK_WITH_TX_HASHES, IsType, OutsideExecutionTypedData, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, ETransactionVersion3 as ETransactionVersion3$1, BlockHash, TransactionHash, 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, INVALID_SUBSCRIPTION_ID, TOO_MANY_ADDRESSES_IN_FILTER, TOO_MANY_BLOCKS_BACK, COMPILATION_ERROR, ETransactionVersion as ETransactionVersion$1, SUBSCRIPTION_ID as SUBSCRIPTION_ID$1, BLOCK_STATUS, BLOCK_HEADER as BLOCK_HEADER$1, BLOCK_BODY_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_HEADER, BLOCK_BODY_WITH_TXS, BLOCK_BODY_WITH_RECEIPTS, BlockTransactionsTraces, TXN_STATUS_RESULT, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, EDAMode as EDAMode$1, StarknetType, StarknetMerkleType, TypedDataRevision, OutsideCallV1, OutsideCallV2, EmittedEvent as EmittedEvent$1, Address, Permission, ChainId, AccountDeploymentData, AddInvokeTransactionParameters, AddInvokeTransactionResult, AddDeclareTransactionParameters, AddDeclareTransactionResult, SpecVersion } from '@starknet-io/starknet-types-09';
2
+ import { CONTRACT, ETransactionType, EDataAvailabilityMode as EDataAvailabilityMode$1, SUBSCRIPTION_BLOCK_ID, IsSucceeded, TransactionReceipt as TransactionReceipt$1, IsReverted, BLOCK_WITH_TX_HASHES, IsType, OutsideExecutionTypedData, TypedData, CONTRACT_STORAGE_KEYS, StorageProof, CASM_COMPILED_CONTRACT_CLASS, ETransactionVersion3 as ETransactionVersion3$1, BlockHash, TransactionHash, 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, 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, BLOCK_STATUS, BLOCK_HEADER, BLOCK_BODY_WITH_TX_HASHES, PRE_CONFIRMED_BLOCK_HEADER, BLOCK_BODY_WITH_TXS, BLOCK_BODY_WITH_RECEIPTS, BlockTransactionsTraces, TXN_STATUS_RESULT, StarknetWindowObject, AccountChangeEventHandler, NetworkChangeEventHandler, WatchAssetParameters, AddStarknetChainParameters, Signature as Signature$1, EDAMode as EDAMode$1, StarknetType, StarknetMerkleType, TypedDataRevision, OutsideCallV1, OutsideCallV2, EmittedEvent as EmittedEvent$1, Address, Permission, ChainId, AccountDeploymentData, AddInvokeTransactionParameters, AddInvokeTransactionResult, AddDeclareTransactionParameters, AddDeclareTransactionResult, SpecVersion } from '@starknet-io/starknet-types-09';
3
3
  export { StarknetDomain, StarknetEnumType, StarknetMerkleType, StarknetType, TypedData, TypedDataRevision } from '@starknet-io/starknet-types-09';
4
4
  import * as RPCSPEC08 from '@starknet-io/starknet-types-08';
5
5
  import { PAYMASTER_API } from '@starknet-io/starknet-types-08';
@@ -491,7 +491,7 @@ declare const ETransactionVersion3: {
491
491
  type BLOCK_HASH = Merge<RPCSPEC08.BLOCK_HASH, RPC.BLOCK_HASH>;
492
492
  type BLOCK_NUMBER = Merge<RPCSPEC08.BLOCK_NUMBER, RPC.BLOCK_NUMBER>;
493
493
  type FELT = Merge<RPCSPEC08.FELT, RPC.FELT>;
494
- type TXN_HASH$1 = Merge<RPCSPEC08.TXN_HASH, RPC.TXN_HASH>;
494
+ type TXN_HASH = Merge<RPCSPEC08.TXN_HASH, RPC.TXN_HASH>;
495
495
  type PRICE_UNIT = Merge<RPCSPEC08.PRICE_UNIT, RPC.PRICE_UNIT>;
496
496
  type RESOURCE_PRICE = Merge<RPCSPEC08.RESOURCE_PRICE, RPC.RESOURCE_PRICE>;
497
497
  type SIMULATION_FLAG = Merge<RPCSPEC08.SIMULATION_FLAG, RPC.SIMULATION_FLAG>;
@@ -790,7 +790,8 @@ type BlockNumber = BlockTag | null | number;
790
790
  * null return 'pending' block tag
791
791
  */
792
792
  type BlockIdentifier = BlockNumber | BigNumberish;
793
- type SubscriptionBlockIdentifier = SUBSCRIPTION_BLOCK_TAG | (string & {}) | number | bigint;
793
+ type SubscriptionBlockTag = Extract<SUBSCRIPTION_BLOCK_ID, string>;
794
+ type SubscriptionBlockIdentifier = SubscriptionBlockTag | (string & {}) | number | bigint;
794
795
  /**
795
796
  * items used by AccountInvocations
796
797
  */
@@ -4226,7 +4227,7 @@ type SubscriptionOptions = {
4226
4227
  /** The parameters used to create this subscription (optional, defaults to empty object) */
4227
4228
  params?: object;
4228
4229
  /** The unique identifier for this subscription */
4229
- id: SUBSCRIPTION_ID$1;
4230
+ id: SUBSCRIPTION_ID;
4230
4231
  /** The maximum number of events to buffer */
4231
4232
  maxBufferSize: number;
4232
4233
  };
@@ -4273,7 +4274,7 @@ declare class Subscription<T = any> {
4273
4274
  * The unique identifier for this subscription.
4274
4275
  * @internal
4275
4276
  */
4276
- id: SUBSCRIPTION_ID$1;
4277
+ id: SUBSCRIPTION_ID;
4277
4278
  private events;
4278
4279
  private buffer;
4279
4280
  private maxBufferSize;
@@ -4313,12 +4314,32 @@ declare class Subscription<T = any> {
4313
4314
  unsubscribe(): Promise<boolean>;
4314
4315
  }
4315
4316
 
4316
- type BLOCK_HEADER = RPCSPEC08.BLOCK_HEADER;
4317
- type EMITTED_EVENT = RPCSPEC08.EMITTED_EVENT;
4318
- type NEW_TXN_STATUS = RPCSPEC08.NEW_TXN_STATUS;
4319
- type SUBSCRIPTION_ID = RPCSPEC08.SUBSCRIPTION_ID;
4320
- type TXN_HASH = RPCSPEC08.TXN_HASH;
4321
- type TXN_WITH_HASH = RPCSPEC08.TXN_WITH_HASH;
4317
+ interface SubscribeNewHeadsParams {
4318
+ blockIdentifier?: SubscriptionBlockIdentifier;
4319
+ }
4320
+ interface SubscribeEventsParams {
4321
+ fromAddress?: BigNumberish;
4322
+ keys?: string[][];
4323
+ blockIdentifier?: SubscriptionBlockIdentifier;
4324
+ finalityStatus?: Exclude<TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1>;
4325
+ }
4326
+ interface SubscribeTransactionStatusParams {
4327
+ transactionHash: BigNumberish;
4328
+ blockIdentifier?: SubscriptionBlockIdentifier;
4329
+ }
4330
+ interface SubscribeNewTransactionReceiptsParams {
4331
+ finalityStatus?: Exclude<TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1>[];
4332
+ senderAddress?: BigNumberish[];
4333
+ }
4334
+ interface SubscribeNewTransactionsParams {
4335
+ finalityStatus?: TXN_STATUS_WITHOUT_L1[];
4336
+ senderAddress?: BigNumberish[];
4337
+ }
4338
+ type SubscriptionNewHeadsEvent = Subscription<NewHeadsEvent['result']>;
4339
+ type SubscriptionStarknetEventsEvent = Subscription<StarknetEventsEvent['result']>;
4340
+ type SubscriptionTransactionStatusEvent = Subscription<TransactionsStatusEvent['result']>;
4341
+ type SubscriptionNewTransactionReceiptsEvent = Subscription<NewTransactionReceiptsEvent['result']>;
4342
+ type SubscriptionNewTransactionEvent = Subscription<NewTransactionEvent['result']>;
4322
4343
  /**
4323
4344
  * Options for configuring the automatic reconnection behavior of the WebSocketChannel.
4324
4345
  */
@@ -4335,6 +4356,9 @@ type ReconnectOptions = {
4335
4356
  */
4336
4357
  delay?: number;
4337
4358
  };
4359
+ /**
4360
+ * The type of the WebSocket implementation.
4361
+ */
4338
4362
  type WebSocketModule = {
4339
4363
  new (nodeUrl: WebSocketOptions['nodeUrl']): WebSocket;
4340
4364
  };
@@ -4522,32 +4546,34 @@ declare class WebSocketChannel {
4522
4546
  private onMessageProxy;
4523
4547
  /**
4524
4548
  * Subscribes to new block headers.
4525
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
4549
+ * @param {SubscribeNewHeadsParams} params - The parameters for the subscription.
4526
4550
  * @returns {Promise<Subscription<BLOCK_HEADER>>} A Promise that resolves with a `Subscription` object for new block headers.
4527
4551
  */
4528
- subscribeNewHeads(blockIdentifier?: SubscriptionBlockIdentifier): Promise<Subscription<BLOCK_HEADER>>;
4552
+ subscribeNewHeads(params?: SubscribeNewHeadsParams): Promise<SubscriptionNewHeadsEvent>;
4529
4553
  /**
4530
4554
  * Subscribes to events matching a given filter.
4531
- * @param {BigNumberish} [fromAddress] - The contract address to filter by.
4532
- * @param {string[][]} [keys] - The event keys to filter by.
4533
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
4555
+ * @param {SubscribeEventsParams} params - The parameters for the subscription.
4534
4556
  * @returns {Promise<Subscription<EMITTED_EVENT>>} A Promise that resolves with a `Subscription` object for the specified events.
4535
4557
  */
4536
- subscribeEvents(fromAddress?: BigNumberish, keys?: string[][], blockIdentifier?: SubscriptionBlockIdentifier): Promise<Subscription<EMITTED_EVENT>>;
4558
+ subscribeEvents(params?: SubscribeEventsParams): Promise<SubscriptionStarknetEventsEvent>;
4537
4559
  /**
4538
4560
  * Subscribes to status updates for a specific transaction.
4539
- * @param {BigNumberish} transactionHash - The hash of the transaction to monitor.
4540
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block context. Not typically required.
4561
+ * @param {SubscribeTransactionStatusParams} params - The parameters for the subscription.
4541
4562
  * @returns {Promise<Subscription<NEW_TXN_STATUS>>} A Promise that resolves with a `Subscription` object for the transaction's status.
4542
4563
  */
4543
- subscribeTransactionStatus(transactionHash: BigNumberish, blockIdentifier?: SubscriptionBlockIdentifier): Promise<Subscription<NEW_TXN_STATUS>>;
4564
+ subscribeTransactionStatus(params: SubscribeTransactionStatusParams): Promise<SubscriptionTransactionStatusEvent>;
4565
+ /**
4566
+ * Subscribes to new transaction receipts.
4567
+ * @param {SubscribeNewTransactionReceiptsParams} params - The parameters for the subscription.
4568
+ * @returns {Promise<Subscription<NewTransactionReceiptsEvent['result']>>} A Promise that resolves with a `Subscription` object for new transaction receipts.
4569
+ */
4570
+ subscribeNewTransactionReceipts(params?: SubscribeNewTransactionReceiptsParams): Promise<SubscriptionNewTransactionReceiptsEvent>;
4544
4571
  /**
4545
- * Subscribes to pending transactions.
4546
- * @param {boolean} [transactionDetails] - If `true`, the full transaction details are included. Defaults to `false` (hash only).
4547
- * @param {BigNumberish[]} [senderAddress] - An array of sender addresses to filter by.
4548
- * @returns {Promise<Subscription<TXN_HASH | TXN_WITH_HASH>>} A Promise that resolves with a `Subscription` object for pending transactions.
4572
+ * Subscribes to new transactions.
4573
+ * @param {SubscribeNewTransactionsParams} params - The parameters for the subscription.
4574
+ * @returns {Promise<Subscription<NewTransactionEvent['result']>>} A Promise that resolves with a `Subscription` object for new transactions.
4549
4575
  */
4550
- subscribePendingTransaction(transactionDetails?: boolean, senderAddress?: BigNumberish[]): Promise<Subscription<TXN_HASH | TXN_WITH_HASH>>;
4576
+ subscribeNewTransactions(params?: SubscribeNewTransactionsParams): Promise<SubscriptionNewTransactionEvent>;
4551
4577
  /**
4552
4578
  * Internal method to remove subscription from active map.
4553
4579
  * @internal
@@ -4639,7 +4665,7 @@ declare class RpcProvider$1 implements ProviderInterface {
4639
4665
  block_number?: undefined;
4640
4666
  }) | ({
4641
4667
  status: BLOCK_STATUS;
4642
- } & BLOCK_HEADER$1 & BLOCK_BODY_WITH_TX_HASHES & {}) | (BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER & {
4668
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & {}) | (BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER & {
4643
4669
  block_hash?: undefined;
4644
4670
  new_root?: undefined;
4645
4671
  status?: undefined;
@@ -4654,7 +4680,7 @@ declare class RpcProvider$1 implements ProviderInterface {
4654
4680
  block_number?: undefined;
4655
4681
  }) | ({
4656
4682
  status: BLOCK_STATUS;
4657
- } & BLOCK_HEADER$1 & BLOCK_BODY_WITH_TXS & {}) | (BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER & {
4683
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & {}) | (BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER & {
4658
4684
  block_hash?: undefined;
4659
4685
  new_root?: undefined;
4660
4686
  status?: undefined;
@@ -4683,7 +4709,7 @@ declare class RpcProvider$1 implements ProviderInterface {
4683
4709
  block_number?: undefined;
4684
4710
  }) | ({
4685
4711
  status: BLOCK_STATUS;
4686
- } & BLOCK_HEADER$1 & BLOCK_BODY_WITH_RECEIPTS & {}) | (BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER & {
4712
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & {}) | (BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER & {
4687
4713
  block_hash?: undefined;
4688
4714
  new_root?: undefined;
4689
4715
  status?: undefined;
@@ -9218,4 +9244,4 @@ declare class Logger {
9218
9244
  */
9219
9245
  declare const logger: Logger;
9220
9246
 
9221
- export { type Abi, type AbiEntry, type AbiEntryType, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, AbiParser1, AbiParser2, AbiParserInterface, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, CairoByteArray, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint512, CairoUint64, CairoUint8, CairoUint96, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type ErrorReceiptResponseHelper, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, Int, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type ParsingStrategy, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, type RevertedTransactionReceiptResponseHelper, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, Subscription, type SubscriptionBlockIdentifier, type SuccessfulTransactionReceiptResponse, type SuccessfulTransactionReceiptResponseHelper, type TXN_EXECUTION_STATUS, type TXN_HASH$1 as TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fastParsingStrategy, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
9247
+ export { type Abi, type AbiEntry, type AbiEntryType, type AbiEnum, type AbiEnums, type AbiEvent, type AbiEvents, type AbiInterfaces, AbiParser1, AbiParser2, AbiParserInterface, type AbiStruct, type AbiStructs, Account, AccountInterface, type AccountInvocationItem, type AccountInvocations, type AccountInvocationsFactoryDetails, type AccountOptions, type AllowArray, type ApiEstimateFeeResponse, type Args, type ArgsOrCalldata, type ArgsOrCalldataWithOptions, type ArraySignatureType, type AsyncContractFunction, type BLOCK_HASH, type BLOCK_NUMBER, BatchClient, type BatchClientOptions, type BigNumberish, type Block$1 as Block, type BlockIdentifier, type BlockNumber, BlockStatus, BlockTag, type BlockWithTxHashes, type Builtins, type ByteArray, type ByteCode, type CairoAssembly, CairoByteArray, type CairoContract, CairoCustomEnum, type CairoEnum, type CairoEnumRaw, type CairoEvent, type CairoEventDefinition, type CairoEventVariant, CairoFixedArray, CairoInt128, CairoInt16, CairoInt32, CairoInt64, CairoInt8, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoUint128, CairoUint16, CairoUint256, CairoUint512, CairoUint64, CairoUint8, CairoUint96, type CairoVersion, type Call, type CallContractResponse, CallData, type CallDetails, type CallOptions, type CallResult, type Calldata, type CommonContractOptions, type CompiledContract, type CompiledSierra, type CompiledSierraCasm, type CompilerVersion, type CompleteDeclareContractPayload, type CompressedProgram, Contract, type ContractClass, type ContractClassIdentifier, type ContractClassPayload, type ContractClassResponse, type ContractEntryPointFields, type ContractFunction, ContractInterface, type ContractOptions, type ContractVersion, type DeclareAndDeployContractPayload, type DeclareContractPayload, type DeclareContractResponse, type DeclareContractTransaction, type DeclareDeployUDCResponse, type DeclareSignerDetails, type DeclareTransactionReceiptResponse, type DeclaredTransaction, type DeployAccountContractPayload, type DeployAccountContractTransaction, type DeployAccountSignerDetails, type DeployAccountTransactionReceiptResponse, type DeployAndInvokeTransaction, type DeployContractResponse, type DeployContractUDCResponse, type DeployTransaction, type DeployTransactionReceiptResponse, type DeployedAccountTransaction, Deployer, type DeployerCall, DeployerInterface, type Details, EDAMode, EDataAvailabilityMode, ETH_ADDRESS, ETransactionExecutionStatus, ETransactionStatus, ETransactionVersion, ETransactionVersion2, ETransactionVersion3, type EVENTS_CHUNK, type EmittedEvent, EntryPointType, type EntryPointsByType, type ErrorReceiptResponseHelper, type EstimateFeeBulk, type EstimateFeeResponseBulkOverhead, type EstimateFeeResponseOverhead, EthSigner, type Event$1 as Event, type EventEntry, type EventFilter, type ExecutableDeployAndInvokeTransaction, type ExecutableDeployTransaction, type ExecutableInvokeTransaction, type ExecutableUserInvoke, type ExecutableUserTransaction, type ExecuteOptions, type ExecutionParameters, type FEE_ESTIMATE, type FELT, type FactoryParams, type FeeEstimate, type FeeMode, type FormatResponse, type FunctionAbi, type GasPrices, type GetBlockResponse, type GetTransactionReceiptResponse, type GetTransactionResponse, type GetTxReceiptResponseWithoutHelper, type HexCalldata, type Hint, Int, type InterfaceAbi, type Invocation, type Invocations, type InvocationsDetails, type InvocationsDetailsWithNonce, type InvocationsSignerDetails, type InvokeFunctionResponse, type InvokeTransaction, type InvokeTransactionReceiptResponse, type InvokedTransaction, type L1HandlerTransactionReceiptResponse, type L1_HANDLER_TXN, type LedgerPathCalculation, LedgerSigner111 as LedgerSigner, LedgerSigner111, LedgerSigner221, LedgerSigner231, type LegacyCompiledContract, type LegacyContractClass, type LegacyEvent, LibraryError, Literal, type LogLevel, LogLevelIndex, type Methods, type MultiDeployContractResponse, type MultiType, NON_ZERO_PREFIX, type Nonce, type OptionalPayload, type OutsideCall, type OutsideExecution, type OutsideExecutionOptions, OutsideExecutionTypesV1, OutsideExecutionTypesV2, OutsideExecutionVersion, type OutsideTransaction, type PENDING_DECLARE_TXN_RECEIPT, type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT, type PENDING_INVOKE_TXN_RECEIPT, type PENDING_L1_HANDLER_TXN_RECEIPT, type PENDING_STATE_UPDATE, type PRE_CONFIRMED_STATE_UPDATE, type PRICE_UNIT, type ParsedEvent, type ParsedEvents, type ParsedStruct, type ParsingStrategy, type PaymasterDetails, type PaymasterFeeEstimate, PaymasterInterface, type PaymasterOptions, PaymasterRpc, type PaymasterRpcOptions, type PaymasterTimeBounds, type PendingBlock, type PendingReceipt, type PendingStateUpdate, type PreConfirmedStateUpdate, type PreparedDeployAndInvokeTransaction, type PreparedDeployTransaction, type PreparedInvokeTransaction, type PreparedTransaction, type Program, RpcProvider as Provider, ProviderInterface, type ProviderOptions, type ProviderOrAccount, type PythonicHints, type RESOURCE_PRICE, index$4 as RPC, rpc_0_8_1 as RPC08, rpc_0_9_0 as RPC09, RPCResponseParser, type RPC_ERROR, type RPC_ERROR_SET, type RawArgs, type RawArgsArray, type RawArgsObject, type RawCalldata, type Receipt, ReceiptTx, type ReconnectOptions, type RequiredKeysOf, type ResourceBounds, type ResourceBoundsBN, type ResourceBoundsOverhead, ResponseParser, type RevertedTransactionReceiptResponse, type RevertedTransactionReceiptResponseHelper, RpcChannel, RpcError, RpcProvider, type RpcProviderOptions, type SIMULATION_FLAG, type STATE_UPDATE, type SierraContractClass, type SierraContractEntryPointFields, type SierraEntryPointsByType, type SierraProgramDebugInfo, type Signature, Signer, SignerInterface, type Simplify, type SimulateTransaction, type SimulateTransactionDetails, type SimulateTransactionOverhead, type SimulateTransactionOverheadResponse, type SimulateTransactionResponse, type SimulationFlags, type StarkProfile, type StateUpdate, type StateUpdateResponse, type Storage, type SubscribeEventsParams, type SubscribeNewHeadsParams, type SubscribeNewTransactionReceiptsParams, type SubscribeNewTransactionsParams, type SubscribeTransactionStatusParams, Subscription, type SubscriptionBlockIdentifier, type SubscriptionNewHeadsEvent, type SubscriptionNewTransactionEvent, type SubscriptionNewTransactionReceiptsEvent, type SubscriptionOptions, type SubscriptionStarknetEventsEvent, type SubscriptionTransactionStatusEvent, type SuccessfulTransactionReceiptResponse, type SuccessfulTransactionReceiptResponseHelper, type TXN_EXECUTION_STATUS, type TXN_HASH, type TXN_STATUS, TimeoutError, type TipAnalysisOptions, type TipEstimate, type TipType, type TokenData, TransactionExecutionStatus, TransactionFinalityStatus, type TransactionReceipt, type TransactionReceiptCallbacks, type TransactionReceiptCallbacksDefault, type TransactionReceiptCallbacksDefined, type TransactionReceiptStatus, type TransactionReceiptValue, type TransactionStatus, type TransactionStatusReceiptSets, type TransactionTrace, TransactionType, type TransactionWithHash, type Tupled, type TypedContractV2, UINT_128_MAX, UINT_128_MIN, UINT_256_HIGH_MAX, UINT_256_HIGH_MIN, UINT_256_LOW_MAX, UINT_256_LOW_MIN, UINT_256_MAX, UINT_256_MIN, UINT_512_MAX, UINT_512_MIN, Uint, type Uint256, type Uint512, type UniversalDeployerContractPayload, type UniversalDetails, type UserInvoke, type UserTransaction, type V3DeclareSignerDetails, type V3DeployAccountSignerDetails, type V3InvocationsSignerDetails, type V3TransactionDetails, ValidateType, WalletAccount, WebSocketChannel, type WebSocketModule, WebSocketNotConnectedError, type WebSocketOptions, type WeierstrassSignatureType, type WithOptions, addAddressPadding, byteArray, cairo, config, constants, contractClassResponseToLegacyCompiledContract, createAbiParser, createTransactionReceipt, defaultDeployer, defaultPaymaster, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fastParsingStrategy, getAbiVersion, getChecksumAddress, type getContractVersionOptions, type getEstimateFeeBulkOptions, getGasPrices, getLedgerPathBuffer111 as getLedgerPathBuffer, getLedgerPathBuffer111, getLedgerPathBuffer221, type getSimulateTransactionOptions, getTipStatsFromBlocks, index$3 as hash, hdParsingStrategy, isAccount, isNoConstructorValid, isPendingBlock, isPendingStateUpdate, isPendingTransaction, isRPC08Plus_ResourceBounds, isRPC08Plus_ResourceBoundsBN, isSierra, isSupportedSpecVersion, isV3Tx, isVersion, json, legacyDeployer, logger, merkle, num, outsideExecution, parseCalldataField, paymaster, provider, selector, shortString, src5, index$1 as stark, starknetId, toAnyPatchVersion, toApiVersion, index$2 as transaction, typedData, uint256$1 as uint256, units, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, verifyMessageInStarknet, type waitForTransactionOptions, connect as wallet };
@@ -15337,7 +15337,7 @@ ${indent}}` : "}";
15337
15337
  }
15338
15338
  };
15339
15339
 
15340
- // src/channel/ws/ws_0_8.ts
15340
+ // src/channel/ws/ws_0_9.ts
15341
15341
  var WebSocketChannel = class {
15342
15342
  /**
15343
15343
  * The URL of the WebSocket RPC Node.
@@ -15685,19 +15685,19 @@ ${indent}}` : "}";
15685
15685
  }
15686
15686
  /**
15687
15687
  * Subscribes to new block headers.
15688
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
15688
+ * @param {SubscribeNewHeadsParams} params - The parameters for the subscription.
15689
15689
  * @returns {Promise<Subscription<BLOCK_HEADER>>} A Promise that resolves with a `Subscription` object for new block headers.
15690
15690
  */
15691
- async subscribeNewHeads(blockIdentifier) {
15691
+ async subscribeNewHeads(params = {}) {
15692
15692
  const method = "starknet_subscribeNewHeads";
15693
- const params = {
15694
- block_id: blockIdentifier ? new Block(blockIdentifier).identifier : void 0
15693
+ const rpcParams = {
15694
+ block_id: params.blockIdentifier ? new Block(params.blockIdentifier).identifier : void 0
15695
15695
  };
15696
- const subId = await this.sendReceive(method, params);
15696
+ const subId = await this.sendReceive(method, rpcParams);
15697
15697
  const subscription = new Subscription({
15698
15698
  channel: this,
15699
15699
  method,
15700
- params,
15700
+ params: rpcParams,
15701
15701
  id: subId,
15702
15702
  maxBufferSize: this.maxBufferSize
15703
15703
  });
@@ -15706,23 +15706,22 @@ ${indent}}` : "}";
15706
15706
  }
15707
15707
  /**
15708
15708
  * Subscribes to events matching a given filter.
15709
- * @param {BigNumberish} [fromAddress] - The contract address to filter by.
15710
- * @param {string[][]} [keys] - The event keys to filter by.
15711
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
15709
+ * @param {SubscribeEventsParams} params - The parameters for the subscription.
15712
15710
  * @returns {Promise<Subscription<EMITTED_EVENT>>} A Promise that resolves with a `Subscription` object for the specified events.
15713
15711
  */
15714
- async subscribeEvents(fromAddress, keys, blockIdentifier) {
15712
+ async subscribeEvents(params = {}) {
15715
15713
  const method = "starknet_subscribeEvents";
15716
- const params = {
15717
- from_address: fromAddress !== void 0 ? toHex(fromAddress) : void 0,
15718
- keys,
15719
- block_id: blockIdentifier ? new Block(blockIdentifier).identifier : void 0
15714
+ const rpcParams = {
15715
+ from_address: params.fromAddress !== void 0 ? toHex(params.fromAddress) : void 0,
15716
+ keys: params.keys,
15717
+ block_id: params.blockIdentifier ? new Block(params.blockIdentifier).identifier : void 0,
15718
+ finality_status: params.finalityStatus
15720
15719
  };
15721
- const subId = await this.sendReceive(method, params);
15720
+ const subId = await this.sendReceive(method, rpcParams);
15722
15721
  const subscription = new Subscription({
15723
15722
  channel: this,
15724
15723
  method,
15725
- params,
15724
+ params: rpcParams,
15726
15725
  id: subId,
15727
15726
  maxBufferSize: this.maxBufferSize
15728
15727
  });
@@ -15731,21 +15730,20 @@ ${indent}}` : "}";
15731
15730
  }
15732
15731
  /**
15733
15732
  * Subscribes to status updates for a specific transaction.
15734
- * @param {BigNumberish} transactionHash - The hash of the transaction to monitor.
15735
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block context. Not typically required.
15733
+ * @param {SubscribeTransactionStatusParams} params - The parameters for the subscription.
15736
15734
  * @returns {Promise<Subscription<NEW_TXN_STATUS>>} A Promise that resolves with a `Subscription` object for the transaction's status.
15737
15735
  */
15738
- async subscribeTransactionStatus(transactionHash, blockIdentifier) {
15736
+ async subscribeTransactionStatus(params) {
15739
15737
  const method = "starknet_subscribeTransactionStatus";
15740
- const params = {
15741
- transaction_hash: toHex(transactionHash),
15742
- block_id: blockIdentifier ? new Block(blockIdentifier).identifier : void 0
15738
+ const rpcParams = {
15739
+ transaction_hash: toHex(params.transactionHash),
15740
+ block_id: params.blockIdentifier ? new Block(params.blockIdentifier).identifier : void 0
15743
15741
  };
15744
- const subId = await this.sendReceive(method, params);
15742
+ const subId = await this.sendReceive(method, rpcParams);
15745
15743
  const subscription = new Subscription({
15746
15744
  channel: this,
15747
15745
  method,
15748
- params,
15746
+ params: rpcParams,
15749
15747
  id: subId,
15750
15748
  maxBufferSize: this.maxBufferSize
15751
15749
  });
@@ -15753,22 +15751,43 @@ ${indent}}` : "}";
15753
15751
  return subscription;
15754
15752
  }
15755
15753
  /**
15756
- * Subscribes to pending transactions.
15757
- * @param {boolean} [transactionDetails] - If `true`, the full transaction details are included. Defaults to `false` (hash only).
15758
- * @param {BigNumberish[]} [senderAddress] - An array of sender addresses to filter by.
15759
- * @returns {Promise<Subscription<TXN_HASH | TXN_WITH_HASH>>} A Promise that resolves with a `Subscription` object for pending transactions.
15754
+ * Subscribes to new transaction receipts.
15755
+ * @param {SubscribeNewTransactionReceiptsParams} params - The parameters for the subscription.
15756
+ * @returns {Promise<Subscription<NewTransactionReceiptsEvent['result']>>} A Promise that resolves with a `Subscription` object for new transaction receipts.
15760
15757
  */
15761
- async subscribePendingTransaction(transactionDetails, senderAddress) {
15762
- const method = "starknet_subscribePendingTransactions";
15763
- const params = {
15764
- transaction_details: transactionDetails,
15765
- sender_address: senderAddress && bigNumberishArrayToHexadecimalStringArray(senderAddress)
15758
+ async subscribeNewTransactionReceipts(params = {}) {
15759
+ const method = "starknet_subscribeNewTransactionReceipts";
15760
+ const rpcParams = {
15761
+ finality_status: params.finalityStatus,
15762
+ sender_address: params.senderAddress && bigNumberishArrayToHexadecimalStringArray(params.senderAddress)
15763
+ };
15764
+ const subId = await this.sendReceive(method, rpcParams);
15765
+ const subscription = new Subscription({
15766
+ channel: this,
15767
+ method,
15768
+ params: rpcParams,
15769
+ id: subId,
15770
+ maxBufferSize: this.maxBufferSize
15771
+ });
15772
+ this.activeSubscriptions.set(subId, subscription);
15773
+ return subscription;
15774
+ }
15775
+ /**
15776
+ * Subscribes to new transactions.
15777
+ * @param {SubscribeNewTransactionsParams} params - The parameters for the subscription.
15778
+ * @returns {Promise<Subscription<NewTransactionEvent['result']>>} A Promise that resolves with a `Subscription` object for new transactions.
15779
+ */
15780
+ async subscribeNewTransactions(params = {}) {
15781
+ const method = "starknet_subscribeNewTransactions";
15782
+ const rpcParams = {
15783
+ finality_status: params.finalityStatus,
15784
+ sender_address: params.senderAddress && bigNumberishArrayToHexadecimalStringArray(params.senderAddress)
15766
15785
  };
15767
- const subId = await this.sendReceive(method, params);
15786
+ const subId = await this.sendReceive(method, rpcParams);
15768
15787
  const subscription = new Subscription({
15769
15788
  channel: this,
15770
15789
  method,
15771
- params,
15790
+ params: rpcParams,
15772
15791
  id: subId,
15773
15792
  maxBufferSize: this.maxBufferSize
15774
15793
  });