starknet 8.2.0 → 8.3.1

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,15 @@
1
+ ## [8.3.1](https://github.com/starknet-io/starknet.js/compare/v8.3.0...v8.3.1) (2025-08-15)
2
+
3
+ ### Bug Fixes
4
+
5
+ - ensure a Buffer type is available for all environments ([6e67834](https://github.com/starknet-io/starknet.js/commit/6e678343876504082d3c232a115b1c48a8f6ce96))
6
+
7
+ # [8.3.0](https://github.com/starknet-io/starknet.js/compare/v8.2.0...v8.3.0) (2025-08-15)
8
+
9
+ ### Features
10
+
11
+ - implement websocket 0.9 ([#1467](https://github.com/starknet-io/starknet.js/issues/1467)) ([7e988c4](https://github.com/starknet-io/starknet.js/commit/7e988c417ac2b4c862dc438b56a149ba7c20439d))
12
+
1
13
  # [8.2.0](https://github.com/starknet-io/starknet.js/compare/v8.1.2...v8.2.0) (2025-08-15)
2
14
 
3
15
  ### 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
  */
@@ -3407,6 +3408,11 @@ type V3DeployAccountSignerDetails = Required<DeployAccountContractPayload> & V3T
3407
3408
  };
3408
3409
  type LedgerPathCalculation = (accountId: number, applicationName: string) => Uint8Array;
3409
3410
 
3411
+ declare global {
3412
+ interface Buffer<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> extends Uint8Array<TArrayBuffer> {
3413
+ }
3414
+ }
3415
+
3410
3416
  declare const LogLevelIndex: {
3411
3417
  DEBUG: number;
3412
3418
  INFO: number;
@@ -4226,7 +4232,7 @@ type SubscriptionOptions = {
4226
4232
  /** The parameters used to create this subscription (optional, defaults to empty object) */
4227
4233
  params?: object;
4228
4234
  /** The unique identifier for this subscription */
4229
- id: SUBSCRIPTION_ID$1;
4235
+ id: SUBSCRIPTION_ID;
4230
4236
  /** The maximum number of events to buffer */
4231
4237
  maxBufferSize: number;
4232
4238
  };
@@ -4273,7 +4279,7 @@ declare class Subscription<T = any> {
4273
4279
  * The unique identifier for this subscription.
4274
4280
  * @internal
4275
4281
  */
4276
- id: SUBSCRIPTION_ID$1;
4282
+ id: SUBSCRIPTION_ID;
4277
4283
  private events;
4278
4284
  private buffer;
4279
4285
  private maxBufferSize;
@@ -4313,12 +4319,32 @@ declare class Subscription<T = any> {
4313
4319
  unsubscribe(): Promise<boolean>;
4314
4320
  }
4315
4321
 
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;
4322
+ interface SubscribeNewHeadsParams {
4323
+ blockIdentifier?: SubscriptionBlockIdentifier;
4324
+ }
4325
+ interface SubscribeEventsParams {
4326
+ fromAddress?: BigNumberish;
4327
+ keys?: string[][];
4328
+ blockIdentifier?: SubscriptionBlockIdentifier;
4329
+ finalityStatus?: Exclude<TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1>;
4330
+ }
4331
+ interface SubscribeTransactionStatusParams {
4332
+ transactionHash: BigNumberish;
4333
+ blockIdentifier?: SubscriptionBlockIdentifier;
4334
+ }
4335
+ interface SubscribeNewTransactionReceiptsParams {
4336
+ finalityStatus?: Exclude<TXN_FINALITY_STATUS, STATUS_ACCEPTED_ON_L1>[];
4337
+ senderAddress?: BigNumberish[];
4338
+ }
4339
+ interface SubscribeNewTransactionsParams {
4340
+ finalityStatus?: TXN_STATUS_WITHOUT_L1[];
4341
+ senderAddress?: BigNumberish[];
4342
+ }
4343
+ type SubscriptionNewHeadsEvent = Subscription<NewHeadsEvent['result']>;
4344
+ type SubscriptionStarknetEventsEvent = Subscription<StarknetEventsEvent['result']>;
4345
+ type SubscriptionTransactionStatusEvent = Subscription<TransactionsStatusEvent['result']>;
4346
+ type SubscriptionNewTransactionReceiptsEvent = Subscription<NewTransactionReceiptsEvent['result']>;
4347
+ type SubscriptionNewTransactionEvent = Subscription<NewTransactionEvent['result']>;
4322
4348
  /**
4323
4349
  * Options for configuring the automatic reconnection behavior of the WebSocketChannel.
4324
4350
  */
@@ -4335,6 +4361,9 @@ type ReconnectOptions = {
4335
4361
  */
4336
4362
  delay?: number;
4337
4363
  };
4364
+ /**
4365
+ * The type of the WebSocket implementation.
4366
+ */
4338
4367
  type WebSocketModule = {
4339
4368
  new (nodeUrl: WebSocketOptions['nodeUrl']): WebSocket;
4340
4369
  };
@@ -4522,32 +4551,34 @@ declare class WebSocketChannel {
4522
4551
  private onMessageProxy;
4523
4552
  /**
4524
4553
  * Subscribes to new block headers.
4525
- * @param {SubscriptionBlockIdentifier} [blockIdentifier] - The block to start receiving notifications from. Defaults to 'latest'.
4554
+ * @param {SubscribeNewHeadsParams} params - The parameters for the subscription.
4526
4555
  * @returns {Promise<Subscription<BLOCK_HEADER>>} A Promise that resolves with a `Subscription` object for new block headers.
4527
4556
  */
4528
- subscribeNewHeads(blockIdentifier?: SubscriptionBlockIdentifier): Promise<Subscription<BLOCK_HEADER>>;
4557
+ subscribeNewHeads(params?: SubscribeNewHeadsParams): Promise<SubscriptionNewHeadsEvent>;
4529
4558
  /**
4530
4559
  * 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'.
4560
+ * @param {SubscribeEventsParams} params - The parameters for the subscription.
4534
4561
  * @returns {Promise<Subscription<EMITTED_EVENT>>} A Promise that resolves with a `Subscription` object for the specified events.
4535
4562
  */
4536
- subscribeEvents(fromAddress?: BigNumberish, keys?: string[][], blockIdentifier?: SubscriptionBlockIdentifier): Promise<Subscription<EMITTED_EVENT>>;
4563
+ subscribeEvents(params?: SubscribeEventsParams): Promise<SubscriptionStarknetEventsEvent>;
4537
4564
  /**
4538
4565
  * 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.
4566
+ * @param {SubscribeTransactionStatusParams} params - The parameters for the subscription.
4541
4567
  * @returns {Promise<Subscription<NEW_TXN_STATUS>>} A Promise that resolves with a `Subscription` object for the transaction's status.
4542
4568
  */
4543
- subscribeTransactionStatus(transactionHash: BigNumberish, blockIdentifier?: SubscriptionBlockIdentifier): Promise<Subscription<NEW_TXN_STATUS>>;
4569
+ subscribeTransactionStatus(params: SubscribeTransactionStatusParams): Promise<SubscriptionTransactionStatusEvent>;
4570
+ /**
4571
+ * Subscribes to new transaction receipts.
4572
+ * @param {SubscribeNewTransactionReceiptsParams} params - The parameters for the subscription.
4573
+ * @returns {Promise<Subscription<NewTransactionReceiptsEvent['result']>>} A Promise that resolves with a `Subscription` object for new transaction receipts.
4574
+ */
4575
+ subscribeNewTransactionReceipts(params?: SubscribeNewTransactionReceiptsParams): Promise<SubscriptionNewTransactionReceiptsEvent>;
4544
4576
  /**
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.
4577
+ * Subscribes to new transactions.
4578
+ * @param {SubscribeNewTransactionsParams} params - The parameters for the subscription.
4579
+ * @returns {Promise<Subscription<NewTransactionEvent['result']>>} A Promise that resolves with a `Subscription` object for new transactions.
4549
4580
  */
4550
- subscribePendingTransaction(transactionDetails?: boolean, senderAddress?: BigNumberish[]): Promise<Subscription<TXN_HASH | TXN_WITH_HASH>>;
4581
+ subscribeNewTransactions(params?: SubscribeNewTransactionsParams): Promise<SubscriptionNewTransactionEvent>;
4551
4582
  /**
4552
4583
  * Internal method to remove subscription from active map.
4553
4584
  * @internal
@@ -4639,7 +4670,7 @@ declare class RpcProvider$1 implements ProviderInterface {
4639
4670
  block_number?: undefined;
4640
4671
  }) | ({
4641
4672
  status: BLOCK_STATUS;
4642
- } & BLOCK_HEADER$1 & BLOCK_BODY_WITH_TX_HASHES & {}) | (BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER & {
4673
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES & {}) | (BLOCK_BODY_WITH_TX_HASHES & PRE_CONFIRMED_BLOCK_HEADER & {
4643
4674
  block_hash?: undefined;
4644
4675
  new_root?: undefined;
4645
4676
  status?: undefined;
@@ -4654,7 +4685,7 @@ declare class RpcProvider$1 implements ProviderInterface {
4654
4685
  block_number?: undefined;
4655
4686
  }) | ({
4656
4687
  status: BLOCK_STATUS;
4657
- } & BLOCK_HEADER$1 & BLOCK_BODY_WITH_TXS & {}) | (BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER & {
4688
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS & {}) | (BLOCK_BODY_WITH_TXS & PRE_CONFIRMED_BLOCK_HEADER & {
4658
4689
  block_hash?: undefined;
4659
4690
  new_root?: undefined;
4660
4691
  status?: undefined;
@@ -4683,7 +4714,7 @@ declare class RpcProvider$1 implements ProviderInterface {
4683
4714
  block_number?: undefined;
4684
4715
  }) | ({
4685
4716
  status: BLOCK_STATUS;
4686
- } & BLOCK_HEADER$1 & BLOCK_BODY_WITH_RECEIPTS & {}) | (BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER & {
4717
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_RECEIPTS & {}) | (BLOCK_BODY_WITH_RECEIPTS & PRE_CONFIRMED_BLOCK_HEADER & {
4687
4718
  block_hash?: undefined;
4688
4719
  new_root?: undefined;
4689
4720
  status?: undefined;
@@ -9218,4 +9249,4 @@ declare class Logger {
9218
9249
  */
9219
9250
  declare const logger: Logger;
9220
9251
 
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 };
9252
+ 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
  });