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.mjs CHANGED
@@ -49,6 +49,7 @@ __export(constants_exports, {
49
49
  RPC_DEFAULT_NODES: () => RPC_DEFAULT_NODES,
50
50
  SNIP9_V1_INTERFACE_ID: () => SNIP9_V1_INTERFACE_ID,
51
51
  SNIP9_V2_INTERFACE_ID: () => SNIP9_V2_INTERFACE_ID,
52
+ SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS: () => SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS,
52
53
  SYSTEM_MESSAGES: () => SYSTEM_MESSAGES,
53
54
  StarknetChainId: () => _StarknetChainId,
54
55
  SupportedRpcVersion: () => _SupportedRpcVersion,
@@ -319,8 +320,8 @@ var DEFAULT_GLOBAL_CONFIG = {
319
320
  blake: void 0
320
321
  };
321
322
  var RPC_DEFAULT_NODES = {
322
- SN_MAIN: [`https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/`],
323
- SN_SEPOLIA: [`https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/`]
323
+ SN_MAIN: [`https://api.zan.top/public/starknet-mainnet/rpc/`],
324
+ SN_SEPOLIA: [`https://api.zan.top/public/starknet-sepolia/rpc/`]
324
325
  };
325
326
  var PAYMASTER_RPC_NODES = {
326
327
  SN_MAIN: [`https://starknet.paymaster.avnu.fi`],
@@ -339,6 +340,7 @@ var SYSTEM_MESSAGES = {
339
340
  consensusFailed: "Consensus failed to finalize the block proposal",
340
341
  txFailsBlockBuildingValidation: "Transaction fails block building validation"
341
342
  };
343
+ var SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS = "0.14.1";
342
344
 
343
345
  // src/global/config.ts
344
346
  var Configuration = class _Configuration {
@@ -5233,8 +5235,8 @@ function computeContractClassHash(contract) {
5233
5235
  }
5234
5236
  return computeLegacyContractClassHash(compiledContract);
5235
5237
  }
5236
- function computeCompiledClassHash(casm, starknetVersion) {
5237
- if (starknetVersion && compareVersions(starknetVersion, "0.14.1") >= 0) {
5238
+ function computeCompiledClassHash(casm, starknetVersion = SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS) {
5239
+ if (compareVersions(starknetVersion, SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS) >= 0) {
5238
5240
  return computeCompiledClassHashBlake(casm);
5239
5241
  }
5240
5242
  return computeCompiledClassHashPoseidon(casm);
@@ -5541,19 +5543,13 @@ var getDefaultNodeUrl = (networkName, mute = false, rpcVersion) => {
5541
5543
  return nodes[randIdx];
5542
5544
  };
5543
5545
  function getDefaultNodes(rpcVersion) {
5544
- const nodes = { ...RPC_DEFAULT_NODES };
5545
- Object.keys(nodes).forEach(function(key, _) {
5546
- nodes[key] = nodes[key].map((it) => {
5547
- if (it === "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/") {
5548
- return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5549
- }
5550
- if (it === "https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/") {
5551
- return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5552
- }
5553
- return `${it}${toApiVersion(rpcVersion)}`;
5554
- });
5555
- });
5556
- return nodes;
5546
+ const apiVersion = toApiVersion(rpcVersion);
5547
+ return Object.fromEntries(
5548
+ Object.entries(RPC_DEFAULT_NODES).map(([key, urls]) => [
5549
+ key,
5550
+ urls.map((url) => `${url}${apiVersion}`)
5551
+ ])
5552
+ );
5557
5553
  }
5558
5554
  function getSupportedRpcVersions() {
5559
5555
  return [...new Set(Object.values(_SupportedRpcVersion))];