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/dist/index.js CHANGED
@@ -225,6 +225,7 @@ __export(constants_exports, {
225
225
  RPC_DEFAULT_NODES: () => RPC_DEFAULT_NODES,
226
226
  SNIP9_V1_INTERFACE_ID: () => SNIP9_V1_INTERFACE_ID,
227
227
  SNIP9_V2_INTERFACE_ID: () => SNIP9_V2_INTERFACE_ID,
228
+ SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS: () => SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS,
228
229
  SYSTEM_MESSAGES: () => SYSTEM_MESSAGES,
229
230
  StarknetChainId: () => _StarknetChainId,
230
231
  SupportedRpcVersion: () => _SupportedRpcVersion,
@@ -494,8 +495,8 @@ var DEFAULT_GLOBAL_CONFIG = {
494
495
  blake: void 0
495
496
  };
496
497
  var RPC_DEFAULT_NODES = {
497
- SN_MAIN: [`https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/`],
498
- SN_SEPOLIA: [`https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/`]
498
+ SN_MAIN: [`https://api.zan.top/public/starknet-mainnet/rpc/`],
499
+ SN_SEPOLIA: [`https://api.zan.top/public/starknet-sepolia/rpc/`]
499
500
  };
500
501
  var PAYMASTER_RPC_NODES = {
501
502
  SN_MAIN: [`https://starknet.paymaster.avnu.fi`],
@@ -514,6 +515,7 @@ var SYSTEM_MESSAGES = {
514
515
  consensusFailed: "Consensus failed to finalize the block proposal",
515
516
  txFailsBlockBuildingValidation: "Transaction fails block building validation"
516
517
  };
518
+ var SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS = "0.14.1";
517
519
 
518
520
  // src/global/config.ts
519
521
  var Configuration = class _Configuration {
@@ -5408,8 +5410,8 @@ function computeContractClassHash(contract) {
5408
5410
  }
5409
5411
  return computeLegacyContractClassHash(compiledContract);
5410
5412
  }
5411
- function computeCompiledClassHash(casm, starknetVersion) {
5412
- if (starknetVersion && compareVersions(starknetVersion, "0.14.1") >= 0) {
5413
+ function computeCompiledClassHash(casm, starknetVersion = SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS) {
5414
+ if (compareVersions(starknetVersion, SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS) >= 0) {
5413
5415
  return computeCompiledClassHashBlake(casm);
5414
5416
  }
5415
5417
  return computeCompiledClassHashPoseidon(casm);
@@ -5716,19 +5718,13 @@ var getDefaultNodeUrl = (networkName, mute = false, rpcVersion) => {
5716
5718
  return nodes[randIdx];
5717
5719
  };
5718
5720
  function getDefaultNodes(rpcVersion) {
5719
- const nodes = { ...RPC_DEFAULT_NODES };
5720
- Object.keys(nodes).forEach(function(key, _) {
5721
- nodes[key] = nodes[key].map((it) => {
5722
- if (it === "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/") {
5723
- return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5724
- }
5725
- if (it === "https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/") {
5726
- return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5727
- }
5728
- return `${it}${toApiVersion(rpcVersion)}`;
5729
- });
5730
- });
5731
- return nodes;
5721
+ const apiVersion = toApiVersion(rpcVersion);
5722
+ return Object.fromEntries(
5723
+ Object.entries(RPC_DEFAULT_NODES).map(([key, urls]) => [
5724
+ key,
5725
+ urls.map((url) => `${url}${apiVersion}`)
5726
+ ])
5727
+ );
5732
5728
  }
5733
5729
  function getSupportedRpcVersions() {
5734
5730
  return [...new Set(Object.values(_SupportedRpcVersion))];