starknet 8.5.3 → 8.5.5

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.5](https://github.com/starknet-io/starknet.js/compare/v8.5.4...v8.5.5) (2025-10-03)
2
+
3
+ ### Bug Fixes
4
+
5
+ - ensure cleanHex has valid output ([f5123b6](https://github.com/starknet-io/starknet.js/commit/f5123b6f9c7fa49ad104a48fd4a1f62e2520488e))
6
+
7
+ ## [8.5.4](https://github.com/starknet-io/starknet.js/compare/v8.5.3...v8.5.4) (2025-09-17)
8
+
9
+ ### Bug Fixes
10
+
11
+ - fix waitfortransaction for rotating nodes services with lifeCycleRetries default 3 ([7296850](https://github.com/starknet-io/starknet.js/commit/72968500c9b0f4b889e9e388b3a98a0ea0de3b43))
12
+
1
13
  ## [8.5.3](https://github.com/starknet-io/starknet.js/compare/v8.5.2...v8.5.3) (2025-09-05)
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
@@ -6049,6 +6078,7 @@ declare function tryToBigInt(value: BigNumberish | undefined): bigint | undefine
6049
6078
  * ```typescript
6050
6079
  * toHex(100); // '0x64'
6051
6080
  * toHex('200'); // '0xc8'
6081
+ * toHex('0x00023AB'); // '0x23ab'
6052
6082
  * ```
6053
6083
  */
6054
6084
  declare function toHex(value: BigNumberish): string;
@@ -6056,6 +6086,15 @@ declare function toHex(value: BigNumberish): string;
6056
6086
  * Alias of ToHex
6057
6087
  */
6058
6088
  declare const toHexString: typeof toHex;
6089
+ /**
6090
+ * Remove hex-string leading zeroes and lowercase it
6091
+ *
6092
+ * @example
6093
+ * ```typescript
6094
+ * cleanHex('0x00023AB'); // '0x23ab'
6095
+ * ```
6096
+ */
6097
+ declare function cleanHex(hex: string): string;
6059
6098
  /**
6060
6099
  * Convert BigNumberish to storage-key-string
6061
6100
  *
@@ -6098,17 +6137,6 @@ declare function toHex64(number: BigNumberish): string;
6098
6137
  * ```
6099
6138
  */
6100
6139
  declare function hexToDecimalString(hex: string): string;
6101
- /**
6102
- * Remove hex-string leading zeroes and lowercase it
6103
- *
6104
- * @param {string} hex hex-string
6105
- * @returns {string} updated string in hex-string format
6106
- * @example
6107
- * ```typescript
6108
- * cleanHex('0x00023AB'); // '0x23ab'
6109
- * ```
6110
- */
6111
- declare function cleanHex(hex: string): string;
6112
6140
  /**
6113
6141
  * Asserts input is equal to or greater then lowerBound and lower then upperBound.
6114
6142
  *
@@ -7625,7 +7653,7 @@ declare function extractAbi(contract: ContractClass): Abi;
7625
7653
  * ```typescript
7626
7654
  * const result= provider.getDefaultNodeUrl(constants.NetworkName.SN_MAIN,false);
7627
7655
  * // console : "Using default public node url, please provide nodeUrl in provider options!"
7628
- * // result = "https://starknet-mainnet.public.blastapi.io/rpc/v0_7"
7656
+ * // result = "https://starknet-mainnet.public.blastapi.io/rpc/v0_9"
7629
7657
  * ```
7630
7658
  */
7631
7659
  declare const getDefaultNodeUrl: (networkName?: _NetworkName, mute?: boolean, rpcVersion?: _SupportedRpcVersion) => string;
@@ -7958,7 +7986,7 @@ declare function isV3Tx(details: InvocationsDetailsWithNonce): details is V3Tran
7958
7986
  * @returns {boolean} True if the response matches the version, false otherwise.
7959
7987
  * @example
7960
7988
  * ``` typescript
7961
- * const result = provider.isVersion("0.7","0.7.1");
7989
+ * const result = provider.isVersion("0.9","0.9.0");
7962
7990
  * // result = true
7963
7991
  * ```
7964
7992
  */