starknet 8.9.0 → 8.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [8.9.2](https://github.com/starknet-io/starknet.js/compare/v8.9.1...v8.9.2) (2025-12-08)
2
+
3
+ ### Bug Fixes
4
+
5
+ - replace alchemy with zan for public node ([264d86b](https://github.com/starknet-io/starknet.js/commit/264d86b7831ced1967c3a8824ecb58bda70e19c2))
6
+
7
+ ## [8.9.1](https://github.com/starknet-io/starknet.js/compare/v8.9.0...v8.9.1) (2025-11-26)
8
+
9
+ ### Bug Fixes
10
+
11
+ - default value for starknetVersion has to be set ([8f3e675](https://github.com/starknet-io/starknet.js/commit/8f3e67538c981cc6880829e04413502f6973538e))
12
+
1
13
  # [8.9.0](https://github.com/starknet-io/starknet.js/compare/v8.8.0...v8.9.0) (2025-11-13)
2
14
 
3
15
  ### Features
package/dist/index.d.ts CHANGED
@@ -3919,8 +3919,8 @@ declare const DEFAULT_GLOBAL_CONFIG: {
3919
3919
  blake: ((uint8Array: Uint8Array) => Uint8Array) | undefined;
3920
3920
  };
3921
3921
  declare const RPC_DEFAULT_NODES: {
3922
- readonly SN_MAIN: readonly ["https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/"];
3923
- readonly SN_SEPOLIA: readonly ["https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/"];
3922
+ readonly SN_MAIN: readonly ["https://api.zan.top/public/starknet-mainnet/rpc/"];
3923
+ readonly SN_SEPOLIA: readonly ["https://api.zan.top/public/starknet-sepolia/rpc/"];
3924
3924
  };
3925
3925
  declare const PAYMASTER_RPC_NODES: {
3926
3926
  readonly SN_MAIN: readonly ["https://starknet.paymaster.avnu.fi"];
@@ -3939,6 +3939,7 @@ declare const SYSTEM_MESSAGES: {
3939
3939
  consensusFailed: string;
3940
3940
  txFailsBlockBuildingValidation: string;
3941
3941
  };
3942
+ declare const SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS: "0.14.1";
3942
3943
 
3943
3944
  declare const constants_ADDR_BOUND: typeof ADDR_BOUND;
3944
3945
  declare const constants_API_VERSION: typeof API_VERSION;
@@ -3968,6 +3969,7 @@ declare const constants_RANGE_U96: typeof RANGE_U96;
3968
3969
  declare const constants_RPC_DEFAULT_NODES: typeof RPC_DEFAULT_NODES;
3969
3970
  declare const constants_SNIP9_V1_INTERFACE_ID: typeof SNIP9_V1_INTERFACE_ID;
3970
3971
  declare const constants_SNIP9_V2_INTERFACE_ID: typeof SNIP9_V2_INTERFACE_ID;
3972
+ declare const constants_SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS: typeof SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS;
3971
3973
  declare const constants_SYSTEM_MESSAGES: typeof SYSTEM_MESSAGES;
3972
3974
  type constants_SupportedCairoVersion = SupportedCairoVersion;
3973
3975
  type constants_SupportedTransactionVersion = SupportedTransactionVersion;
@@ -3975,7 +3977,7 @@ declare const constants_TEXT_TO_FELT_MAX_LEN: typeof TEXT_TO_FELT_MAX_LEN;
3975
3977
  declare const constants_UDC: typeof UDC;
3976
3978
  declare const constants_ZERO: typeof ZERO;
3977
3979
  declare namespace constants {
3978
- export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, constants_DEFAULT_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, constants_HARDENING_4BYTES as HARDENING_4BYTES, constants_HARDENING_BYTE as HARDENING_BYTE, constants_IS_BROWSER as IS_BROWSER, constants_LegacyUDC as LegacyUDC, constants_MASK_250 as MASK_250, constants_MASK_31 as MASK_31, constants_MAX_STORAGE_ITEM_SIZE as MAX_STORAGE_ITEM_SIZE, _NetworkName as NetworkName, constants_OutsideExecutionCallerAny as OutsideExecutionCallerAny, constants_PAYMASTER_RPC_NODES as PAYMASTER_RPC_NODES, constants_PRIME as PRIME, constants_RANGE_FELT as RANGE_FELT, constants_RANGE_I128 as RANGE_I128, constants_RANGE_I16 as RANGE_I16, constants_RANGE_I32 as RANGE_I32, constants_RANGE_I64 as RANGE_I64, constants_RANGE_I8 as RANGE_I8, constants_RANGE_U128 as RANGE_U128, constants_RANGE_U16 as RANGE_U16, constants_RANGE_U32 as RANGE_U32, constants_RANGE_U64 as RANGE_U64, constants_RANGE_U8 as RANGE_U8, constants_RANGE_U96 as RANGE_U96, constants_RPC_DEFAULT_NODES as RPC_DEFAULT_NODES, constants_SNIP9_V1_INTERFACE_ID as SNIP9_V1_INTERFACE_ID, constants_SNIP9_V2_INTERFACE_ID as SNIP9_V2_INTERFACE_ID, constants_SYSTEM_MESSAGES as SYSTEM_MESSAGES, _StarknetChainId as StarknetChainId, type constants_SupportedCairoVersion as SupportedCairoVersion, _SupportedRpcVersion as SupportedRpcVersion, type constants_SupportedTransactionVersion as SupportedTransactionVersion, constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN, _TransactionHashPrefix as TransactionHashPrefix, constants_UDC as UDC, constants_ZERO as ZERO };
3980
+ export { constants_ADDR_BOUND as ADDR_BOUND, constants_API_VERSION as API_VERSION, _BaseUrl as BaseUrl, constants_DEFAULT_GLOBAL_CONFIG as DEFAULT_GLOBAL_CONFIG, constants_HARDENING_4BYTES as HARDENING_4BYTES, constants_HARDENING_BYTE as HARDENING_BYTE, constants_IS_BROWSER as IS_BROWSER, constants_LegacyUDC as LegacyUDC, constants_MASK_250 as MASK_250, constants_MASK_31 as MASK_31, constants_MAX_STORAGE_ITEM_SIZE as MAX_STORAGE_ITEM_SIZE, _NetworkName as NetworkName, constants_OutsideExecutionCallerAny as OutsideExecutionCallerAny, constants_PAYMASTER_RPC_NODES as PAYMASTER_RPC_NODES, constants_PRIME as PRIME, constants_RANGE_FELT as RANGE_FELT, constants_RANGE_I128 as RANGE_I128, constants_RANGE_I16 as RANGE_I16, constants_RANGE_I32 as RANGE_I32, constants_RANGE_I64 as RANGE_I64, constants_RANGE_I8 as RANGE_I8, constants_RANGE_U128 as RANGE_U128, constants_RANGE_U16 as RANGE_U16, constants_RANGE_U32 as RANGE_U32, constants_RANGE_U64 as RANGE_U64, constants_RANGE_U8 as RANGE_U8, constants_RANGE_U96 as RANGE_U96, constants_RPC_DEFAULT_NODES as RPC_DEFAULT_NODES, constants_SNIP9_V1_INTERFACE_ID as SNIP9_V1_INTERFACE_ID, constants_SNIP9_V2_INTERFACE_ID as SNIP9_V2_INTERFACE_ID, constants_SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS as SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS, constants_SYSTEM_MESSAGES as SYSTEM_MESSAGES, _StarknetChainId as StarknetChainId, type constants_SupportedCairoVersion as SupportedCairoVersion, _SupportedRpcVersion as SupportedRpcVersion, type constants_SupportedTransactionVersion as SupportedTransactionVersion, constants_TEXT_TO_FELT_MAX_LEN as TEXT_TO_FELT_MAX_LEN, _TransactionHashPrefix as TransactionHashPrefix, constants_UDC as UDC, constants_ZERO as ZERO };
3979
3981
  }
3980
3982
 
3981
3983
  declare class RpcChannel$1 {
@@ -7773,7 +7775,9 @@ declare const getDefaultNodeUrl: (networkName?: _NetworkName, mute?: boolean, rp
7773
7775
  /**
7774
7776
  * return Defaults RPC Nodes endpoints
7775
7777
  */
7776
- declare function getDefaultNodes(rpcVersion: _SupportedRpcVersion): any;
7778
+ declare function getDefaultNodes(rpcVersion: _SupportedRpcVersion): {
7779
+ [k: string]: string[];
7780
+ };
7777
7781
  /**
7778
7782
  * Return supported RPC versions
7779
7783
  * @returns {SupportedRpcVersion[]} available RPC versions
@@ -214,6 +214,7 @@ var starknet = (() => {
214
214
  RPC_DEFAULT_NODES: () => RPC_DEFAULT_NODES,
215
215
  SNIP9_V1_INTERFACE_ID: () => SNIP9_V1_INTERFACE_ID,
216
216
  SNIP9_V2_INTERFACE_ID: () => SNIP9_V2_INTERFACE_ID,
217
+ SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS: () => SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS,
217
218
  SYSTEM_MESSAGES: () => SYSTEM_MESSAGES,
218
219
  StarknetChainId: () => _StarknetChainId,
219
220
  SupportedRpcVersion: () => _SupportedRpcVersion,
@@ -1179,8 +1180,8 @@ var starknet = (() => {
1179
1180
  blake: void 0
1180
1181
  };
1181
1182
  var RPC_DEFAULT_NODES = {
1182
- SN_MAIN: [`https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/`],
1183
- SN_SEPOLIA: [`https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/`]
1183
+ SN_MAIN: [`https://api.zan.top/public/starknet-mainnet/rpc/`],
1184
+ SN_SEPOLIA: [`https://api.zan.top/public/starknet-sepolia/rpc/`]
1184
1185
  };
1185
1186
  var PAYMASTER_RPC_NODES = {
1186
1187
  SN_MAIN: [`https://starknet.paymaster.avnu.fi`],
@@ -1199,6 +1200,7 @@ var starknet = (() => {
1199
1200
  consensusFailed: "Consensus failed to finalize the block proposal",
1200
1201
  txFailsBlockBuildingValidation: "Transaction fails block building validation"
1201
1202
  };
1203
+ var SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS = "0.14.1";
1202
1204
 
1203
1205
  // src/global/config.ts
1204
1206
  var Configuration = class _Configuration {
@@ -9938,8 +9940,8 @@ ${indent}}` : "}";
9938
9940
  }
9939
9941
  return computeLegacyContractClassHash(compiledContract);
9940
9942
  }
9941
- function computeCompiledClassHash(casm, starknetVersion) {
9942
- if (starknetVersion && compareVersions(starknetVersion, "0.14.1") >= 0) {
9943
+ function computeCompiledClassHash(casm, starknetVersion = SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS) {
9944
+ if (compareVersions(starknetVersion, SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS) >= 0) {
9943
9945
  return computeCompiledClassHashBlake(casm);
9944
9946
  }
9945
9947
  return computeCompiledClassHashPoseidon(casm);
@@ -14754,19 +14756,13 @@ ${indent}}` : "}";
14754
14756
  return nodes[randIdx];
14755
14757
  };
14756
14758
  function getDefaultNodes(rpcVersion) {
14757
- const nodes = { ...RPC_DEFAULT_NODES };
14758
- Object.keys(nodes).forEach(function(key, _) {
14759
- nodes[key] = nodes[key].map((it) => {
14760
- if (it === "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/") {
14761
- return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
14762
- }
14763
- if (it === "https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/") {
14764
- return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
14765
- }
14766
- return `${it}${toApiVersion(rpcVersion)}`;
14767
- });
14768
- });
14769
- return nodes;
14759
+ const apiVersion = toApiVersion(rpcVersion);
14760
+ return Object.fromEntries(
14761
+ Object.entries(RPC_DEFAULT_NODES).map(([key, urls]) => [
14762
+ key,
14763
+ urls.map((url) => `${url}${apiVersion}`)
14764
+ ])
14765
+ );
14770
14766
  }
14771
14767
  function getSupportedRpcVersions() {
14772
14768
  return [...new Set(Object.values(_SupportedRpcVersion))];