starknet 8.5.2 → 8.5.4

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.5.4](https://github.com/starknet-io/starknet.js/compare/v8.5.3...v8.5.4) (2025-09-17)
2
+
3
+ ### Bug Fixes
4
+
5
+ - fix waitfortransaction for rotating nodes services with lifeCycleRetries default 3 ([7296850](https://github.com/starknet-io/starknet.js/commit/72968500c9b0f4b889e9e388b3a98a0ea0de3b43))
6
+
7
+ ## [8.5.3](https://github.com/starknet-io/starknet.js/compare/v8.5.2...v8.5.3) (2025-09-05)
8
+
9
+ ### Bug Fixes
10
+
11
+ - enforce fixed size for cairo bytes ([6a56166](https://github.com/starknet-io/starknet.js/commit/6a56166e65c79d68e012083cefff3fb532e150ac))
12
+
1
13
  ## [8.5.2](https://github.com/starknet-io/starknet.js/compare/v8.5.1...v8.5.2) (2025-08-27)
2
14
 
3
15
  ### Bug Fixes
package/README.md CHANGED
@@ -82,6 +82,6 @@ This library would not be possible without these rockstars.
82
82
 
83
83
  ## 📜 License
84
84
 
85
- Copyright (c) 2024 StarkWare
85
+ Copyright (c) 2025 StarkWare
86
86
 
87
87
  Licensed under the [MIT license](https://github.com/starknet-io/starknet.js/blob/main/LICENSE).
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_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';
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, 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, 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';
@@ -829,8 +829,26 @@ type ParsedStruct = {
829
829
  [key: string]: BigNumberish | BigNumberish[] | ParsedStruct | Uint256;
830
830
  };
831
831
  type waitForTransactionOptions = {
832
+ /**
833
+ * Define the number of retries before throwing an error for the transaction life cycle when the transaction is not found after it had a valid status.
834
+ * This is useful for nodes that are not fully synced yet when connecting to service that rotate nodes.
835
+ */
836
+ lifeCycleRetries?: number;
837
+ /**
838
+ * Define the number of retries before throwing an error
839
+ */
840
+ retries?: number;
841
+ /**
842
+ * Define the time interval between retries in milliseconds
843
+ */
832
844
  retryInterval?: number;
845
+ /**
846
+ * Define which states are considered as successful
847
+ */
833
848
  successStates?: Array<TransactionFinalityStatus | TransactionExecutionStatus>;
849
+ /**
850
+ * Define which states are considered as errors
851
+ */
834
852
  errorStates?: Array<TransactionFinalityStatus | TransactionExecutionStatus>;
835
853
  };
836
854
  type fastWaitForTransactionOptions = {
@@ -865,8 +883,17 @@ interface ProviderOptions extends RpcProviderOptions {
865
883
  }
866
884
  type RpcProviderOptions = {
867
885
  nodeUrl?: string | _NetworkName;
868
- retries?: number;
886
+ /**
887
+ * Define the number of retries for waitForTransaction
888
+ */
889
+ retries?: waitForTransactionOptions['retries'];
890
+ /**
891
+ * Define the time interval between retries in milliseconds
892
+ */
869
893
  transactionRetryIntervalFallback?: number;
894
+ /**
895
+ * Define the headers
896
+ */
870
897
  headers?: object;
871
898
  blockIdentifier?: BlockIdentifier;
872
899
  chainId?: _StarknetChainId;
@@ -3309,6 +3336,8 @@ type RPC_ERROR_SET = {
3309
3336
  UNSUPPORTED_TX_VERSION: UNSUPPORTED_TX_VERSION;
3310
3337
  UNSUPPORTED_CONTRACT_CLASS_VERSION: UNSUPPORTED_CONTRACT_CLASS_VERSION;
3311
3338
  UNEXPECTED_ERROR: UNEXPECTED_ERROR;
3339
+ REPLACEMENT_TRANSACTION_UNDERPRICED: REPLACEMENT_TRANSACTION_UNDERPRICED;
3340
+ FEE_BELOW_MINIMUM: FEE_BELOW_MINIMUM;
3312
3341
  INVALID_SUBSCRIPTION_ID: INVALID_SUBSCRIPTION_ID;
3313
3342
  TOO_MANY_ADDRESSES_IN_FILTER: TOO_MANY_ADDRESSES_IN_FILTER;
3314
3343
  TOO_MANY_BLOCKS_BACK: TOO_MANY_BLOCKS_BACK;
@@ -3965,7 +3994,7 @@ declare class RpcChannel$1 {
3965
3994
  getChainId(): Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">;
3966
3995
  /**
3967
3996
  * fetch rpc node specVersion
3968
- * @example this.specVersion = "0.7.1"
3997
+ * @example this.specVersion = "0.8.1"
3969
3998
  */
3970
3999
  getSpecVersion(): Promise<string>;
3971
4000
  /**
@@ -4108,12 +4137,12 @@ declare class RpcChannel {
4108
4137
  getChainId(): Promise<"0x534e5f4d41494e" | "0x534e5f5345504f4c4941">;
4109
4138
  /**
4110
4139
  * fetch rpc node specVersion
4111
- * @example this.specVersion = "0.7.1"
4140
+ * @example this.specVersion = "0.9.0"
4112
4141
  */
4113
4142
  getSpecVersion(): Promise<string>;
4114
4143
  /**
4115
4144
  * fetch if undefined else just return this.specVersion
4116
- * @example this.specVersion = "0.8.1"
4145
+ * @example this.specVersion = "0.9.0"
4117
4146
  */
4118
4147
  setUpSpecVersion(): Promise<"0.8.1" | "0.9.0">;
4119
4148
  /**
@@ -4620,7 +4649,7 @@ declare class RpcError<BaseErrorT extends RPC_ERROR = RPC_ERROR> extends Library
4620
4649
  params: any;
4621
4650
  };
4622
4651
  constructor(baseError: BaseErrorT, method: string, params: any);
4623
- get code(): 1 | 66 | 10 | 31 | 20 | 21 | 24 | 27 | 28 | 29 | 32 | 33 | 34 | 40 | 41 | 42 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 67 | 68 | 100 | 150 | 151 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 163;
4652
+ get code(): 1 | 64 | 66 | 10 | 31 | 20 | 21 | 24 | 27 | 28 | 29 | 32 | 33 | 34 | 40 | 41 | 42 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 65 | 67 | 68 | 100 | 150 | 151 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 163;
4624
4653
  /**
4625
4654
  * Verifies the underlying RPC error, also serves as a type guard for the _baseError_ property
4626
4655
  * @example
@@ -7625,7 +7654,7 @@ declare function extractAbi(contract: ContractClass): Abi;
7625
7654
  * ```typescript
7626
7655
  * const result= provider.getDefaultNodeUrl(constants.NetworkName.SN_MAIN,false);
7627
7656
  * // console : "Using default public node url, please provide nodeUrl in provider options!"
7628
- * // result = "https://starknet-mainnet.public.blastapi.io/rpc/v0_7"
7657
+ * // result = "https://starknet-mainnet.public.blastapi.io/rpc/v0_9"
7629
7658
  * ```
7630
7659
  */
7631
7660
  declare const getDefaultNodeUrl: (networkName?: _NetworkName, mute?: boolean, rpcVersion?: _SupportedRpcVersion) => string;
@@ -7958,7 +7987,7 @@ declare function isV3Tx(details: InvocationsDetailsWithNonce): details is V3Tran
7958
7987
  * @returns {boolean} True if the response matches the version, false otherwise.
7959
7988
  * @example
7960
7989
  * ``` typescript
7961
- * const result = provider.isVersion("0.7","0.7.1");
7990
+ * const result = provider.isVersion("0.9","0.9.0");
7962
7991
  * // result = true
7963
7992
  * ```
7964
7993
  */
@@ -8513,7 +8542,10 @@ declare class CairoBytes31 {
8513
8542
  toApiRequest(): string[];
8514
8543
  toBigInt(): bigint;
8515
8544
  decodeUtf8(): string;
8516
- toHexString(): string;
8545
+ /**
8546
+ * @param padded flag for including leading zeros
8547
+ */
8548
+ toHexString(padded?: 'padded'): string;
8517
8549
  static validate(data: Uint8Array | string | Buffer | unknown): void;
8518
8550
  static is(data: Uint8Array | string | Buffer): boolean;
8519
8551
  /**
@@ -8600,6 +8632,15 @@ declare class CairoByteArray {
8600
8632
  toBigInt(): bigint;
8601
8633
  toHexString(): string;
8602
8634
  toBuffer(): any;
8635
+ /**
8636
+ * returns an array of all the data chunks and the pending word
8637
+ * when concatenated, represents the original bytes sequence
8638
+ */
8639
+ toElements(): Uint8Array[];
8640
+ /**
8641
+ * Private helper to check if the CairoByteArray is properly initialized
8642
+ */
8643
+ private assertInitialized;
8603
8644
  static validate(data: Uint8Array | Buffer | BigNumberish | unknown): void;
8604
8645
  /**
8605
8646
  * Check if the provided data is a valid CairoByteArray
@@ -8612,14 +8653,6 @@ declare class CairoByteArray {
8612
8653
  * Check if provided abi type is this data type
8613
8654
  */
8614
8655
  static isAbiType(abiType: string): boolean;
8615
- /**
8616
- * Private helper to check if the CairoByteArray is properly initialized
8617
- */
8618
- private assertInitialized;
8619
- /**
8620
- * Private helper to reconstruct the full byte sequence from chunks and pending word
8621
- */
8622
- private reconstructBytes;
8623
8656
  static factoryFromApiResponse(responseIterator: Iterator<string>): CairoByteArray;
8624
8657
  }
8625
8658