@gfxlabs/oku-chains 1.12.4 → 1.12.6

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.js CHANGED
@@ -6842,6 +6842,196 @@ const zkSync = makeConfig({
6842
6842
  },
6843
6843
  });
6844
6844
 
6845
+ /**
6846
+ * Placeholder numeric `id` used by non-EVM chains.
6847
+ *
6848
+ * viem's `Chain` (which {@link IChainInfo} extends) requires a numeric `id`,
6849
+ * but non-EVM chains (e.g. Bitcoin) have no EVM chain id. They use `0` as a
6850
+ * sentinel and rely on `caip2Namespace` + `caip2Reference` for identity and
6851
+ * resolution instead. `0` is never a valid EVM chain id, so it cannot collide.
6852
+ */
6853
+ const NON_EVM_CHAIN_ID = 0;
6854
+ /**
6855
+ * High-level chain family, derived from the chain's CAIP-2 namespace.
6856
+ *
6857
+ * The underlying string value of each member is the CAIP-2 namespace it maps
6858
+ * to (e.g. `eip155` for EVM, `bip122` for Bitcoin), so {@link chainType} can
6859
+ * resolve a chain's type directly from its `caip2Namespace` without relying on
6860
+ * sentinel values like {@link NON_EVM_CHAIN_ID}.
6861
+ *
6862
+ * @see https://chainagnostic.org/CAIPs/caip-2
6863
+ */
6864
+ var ChainType;
6865
+ (function (ChainType) {
6866
+ /** EVM chains (CAIP-2 namespace `eip155`). */
6867
+ ChainType["EVM"] = "eip155";
6868
+ /** Bitcoin (CAIP-2 namespace `bip122`). */
6869
+ ChainType["Bitcoin"] = "bip122";
6870
+ /** Solana (CAIP-2 namespace `solana`). */
6871
+ ChainType["Solana"] = "solana";
6872
+ /** Unknown / unrecognized CAIP-2 namespace. */
6873
+ ChainType["Unknown"] = "";
6874
+ })(ChainType || (ChainType = {}));
6875
+ /** All recognized CAIP-2 namespaces, keyed by {@link ChainType}. */
6876
+ const CHAIN_TYPE_BY_NAMESPACE = {
6877
+ [ChainType.EVM]: ChainType.EVM,
6878
+ [ChainType.Bitcoin]: ChainType.Bitcoin,
6879
+ [ChainType.Solana]: ChainType.Solana,
6880
+ };
6881
+ /**
6882
+ * Resolve a CAIP-2 namespace from a chain-like value:
6883
+ * - an {@link IChainInfo} object: its `caip2Namespace`
6884
+ * - a CAIP-2 identifier string (e.g. `"eip155:1"`): the part before the `:`
6885
+ * - a bare namespace string (e.g. `"eip155"`): used verbatim
6886
+ *
6887
+ * Note: a bare internal name (e.g. `"bitcoin"`) or numeric id is NOT a CAIP-2
6888
+ * namespace and resolves to {@link ChainType.Unknown} here. Use the
6889
+ * index-bound `chainType`/`isNetworkType` in the package entrypoint to resolve
6890
+ * those (they look the chain up first).
6891
+ */
6892
+ function namespaceOf(c) {
6893
+ if (typeof c === "string") {
6894
+ const sep = c.indexOf(":");
6895
+ return sep === -1 ? c : c.slice(0, sep);
6896
+ }
6897
+ return c.caip2Namespace;
6898
+ }
6899
+ /**
6900
+ * The {@link ChainType} of a chain, derived from its CAIP-2 namespace.
6901
+ *
6902
+ * Accepts an {@link IChainInfo} object or a CAIP-2 string (a full identifier
6903
+ * like `"eip155:1"` or a bare namespace like `"bip122"`). This is the
6904
+ * canonical way to determine a chain's family. Prefer it over inspecting the
6905
+ * numeric `id` (which is a placeholder for non-EVM chains).
6906
+ *
6907
+ * @example
6908
+ * ```ts
6909
+ * import { mainnet, bitcoin } from "@gfxlabs/oku-chains";
6910
+ * chainType(mainnet) // => ChainType.EVM
6911
+ * chainType(bitcoin) // => ChainType.Bitcoin
6912
+ * chainType("eip155:1") // => ChainType.EVM
6913
+ * chainType("bip122") // => ChainType.Bitcoin
6914
+ * ```
6915
+ */
6916
+ function chainType$1(c) {
6917
+ return CHAIN_TYPE_BY_NAMESPACE[namespaceOf(c)] ?? ChainType.Unknown;
6918
+ }
6919
+ /**
6920
+ * True if the chain belongs to the given {@link ChainType} family.
6921
+ *
6922
+ * Reusable, namespace-driven replacement for one-off `isBitcoinChain` style
6923
+ * checks. The chain may be an {@link IChainInfo} object or a CAIP-2 string.
6924
+ *
6925
+ * @example
6926
+ * ```ts
6927
+ * import { ChainType, isNetworkType, bitcoin } from "@gfxlabs/oku-chains";
6928
+ * isNetworkType(ChainType.Bitcoin, bitcoin) // => true
6929
+ * isNetworkType(ChainType.EVM, bitcoin) // => false
6930
+ * isNetworkType(ChainType.EVM, "eip155:1") // => true
6931
+ * ```
6932
+ */
6933
+ function isNetworkType$1(type, c) {
6934
+ return chainType$1(c) === type;
6935
+ }
6936
+ /**
6937
+ * True if the chain is an EVM chain (CAIP-2 namespace `eip155`). Accepts an
6938
+ * {@link IChainInfo} object or a CAIP-2 string.
6939
+ */
6940
+ function isEvmChain$1(c) {
6941
+ return isNetworkType$1(ChainType.EVM, c);
6942
+ }
6943
+ /**
6944
+ * True if the chain is non-EVM (i.e. its CAIP-2 namespace is not `eip155`).
6945
+ * Non-EVM chains live in the same {@link IChainInfo} shape as EVM chains, so
6946
+ * EVM-only fields (contracts, uniswap metadata, etc.) will be present but
6947
+ * empty. Accepts an {@link IChainInfo} object or a CAIP-2 string.
6948
+ */
6949
+ function isNonEvmChain$1(c) {
6950
+ return !isEvmChain$1(c);
6951
+ }
6952
+
6953
+ /**
6954
+ * Bitcoin mainnet.
6955
+ *
6956
+ * A non-EVM chain expressed within the EVM-shaped {@link IChainInfo} so it
6957
+ * flows through the existing resolvers and consumers unchanged. Because viem's
6958
+ * `Chain` requires a numeric `id`, Bitcoin uses the {@link NON_EVM_CHAIN_ID}
6959
+ * (`0`) placeholder and is identified/resolved via CAIP-2 instead:
6960
+ * `bip122:000000000019d6689c085ae165831e93`, where the reference is the first
6961
+ * 32 hex chars of the genesis block hash per the CAIP-2 `bip122` namespace.
6962
+ *
6963
+ * EVM-only fields (uniswap, morpho, contracts, etc.) are present but empty.
6964
+ *
6965
+ * Refs:
6966
+ * - https://github.com/ChainAgnostic/namespaces/blob/main/bip122/caip2.md
6967
+ */
6968
+ const chain = defineChain({
6969
+ id: NON_EVM_CHAIN_ID,
6970
+ name: "Bitcoin",
6971
+ nativeCurrency: {
6972
+ name: "Bitcoin",
6973
+ symbol: "BTC",
6974
+ decimals: 8,
6975
+ },
6976
+ rpcUrls: {
6977
+ default: {
6978
+ http: ["https://bitcoin-rpc.publicnode.com"],
6979
+ },
6980
+ },
6981
+ blockExplorers: {
6982
+ default: {
6983
+ name: "mempool.space",
6984
+ url: "https://mempool.space",
6985
+ apiUrl: "https://mempool.space/api",
6986
+ },
6987
+ },
6988
+ });
6989
+ const bitcoin = makeConfig({
6990
+ ...chain,
6991
+ caip2Namespace: "bip122",
6992
+ caip2Reference: "000000000019d6689c085ae165831e93",
6993
+ internalName: "bitcoin",
6994
+ transactionType: "bitcoin",
6995
+ sortIndex: 1000,
6996
+ launchTime: 1231006505,
6997
+ blockTimeSeconds: 600,
6998
+ deprecated: false,
6999
+ logoUrl: "https://cms.oku.trade/cdn/public/chains/bitcoin-logo.webp",
7000
+ nativeLogoUrl: "https://cms.oku.trade/cdn/public/natives/btc.png",
7001
+ blockAid: "bitcoin",
7002
+ estimatedSwapGas: 0,
7003
+ estimatedBridgeGas: 0,
7004
+ estimatedWrapGas: 0,
7005
+ initCodeHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
7006
+ defaultPool: "0x0000000000000000000000000000000000000000",
7007
+ defaultToken0: "0x0000000000000000000000000000000000000000",
7008
+ defaultToken1: "0x0000000000000000000000000000000000000000",
7009
+ tokenList: [],
7010
+ stables: [],
7011
+ watchlist: [],
7012
+ v4Watchlist: [],
7013
+ externalId: {
7014
+ coingecko: "bitcoin",
7015
+ },
7016
+ markets: {},
7017
+ bridges: {},
7018
+ oracles: {
7019
+ coingecko: {
7020
+ slug: "bitcoin",
7021
+ native: "bitcoin",
7022
+ },
7023
+ },
7024
+ uniswap: {},
7025
+ morpho: {},
7026
+ token: {},
7027
+ oku: {},
7028
+ contracts: {
7029
+ nftManager: {
7030
+ address: "0x0000000000000000000000000000000000000000",
7031
+ },
7032
+ },
7033
+ });
7034
+
6845
7035
  /**
6846
7036
  * Parse a CAIP-2 chain ID string into its namespace and reference components.
6847
7037
  *
@@ -6875,20 +7065,33 @@ function parseCAIP2(caip2) {
6875
7065
  function formatCAIP2(id) {
6876
7066
  return `${id.namespace}:${id.reference}`;
6877
7067
  }
7068
+ /**
7069
+ * The CAIP-2 reference component for a chain.
7070
+ *
7071
+ * If the chain sets an explicit `caip2Reference` (e.g. a non-EVM chain like
7072
+ * Bitcoin, whose reference is a genesis hash prefix), it is used verbatim.
7073
+ * Otherwise the reference is derived from the numeric `id` (the historical
7074
+ * behavior for EVM chains, e.g. "1" for Ethereum mainnet).
7075
+ */
7076
+ function caip2Reference(chain) {
7077
+ return chain.caip2Reference ?? String(chain.id);
7078
+ }
6878
7079
  /**
6879
7080
  * Convert a chain config to its CAIP-2 identifier string.
6880
7081
  *
6881
7082
  * @example
6882
7083
  * ```ts
6883
- * import { mainnet } from "@gfxlabs/oku-chains";
7084
+ * import { mainnet, bitcoin } from "@gfxlabs/oku-chains";
6884
7085
  * toCAIP2(mainnet)
6885
7086
  * // => "eip155:1"
7087
+ * toCAIP2(bitcoin)
7088
+ * // => "bip122:000000000019d6689c085ae165831e93"
6886
7089
  * ```
6887
7090
  */
6888
7091
  function toCAIP2(chain) {
6889
7092
  return formatCAIP2({
6890
7093
  namespace: chain.caip2Namespace,
6891
- reference: String(chain.id),
7094
+ reference: caip2Reference(chain),
6892
7095
  });
6893
7096
  }
6894
7097
  /**
@@ -6905,7 +7108,7 @@ function toCAIP2(chain) {
6905
7108
  */
6906
7109
  function fromCAIP2(caip2, chains) {
6907
7110
  const { namespace, reference } = parseCAIP2(caip2);
6908
- const chain = chains.find((c) => c.caip2Namespace === namespace && String(c.id) === reference);
7111
+ const chain = chains.find((c) => c.caip2Namespace === namespace && caip2Reference(c) === reference);
6909
7112
  if (!chain) {
6910
7113
  throw new Error(`No chain found for CAIP-2 identifier: "${caip2}"`);
6911
7114
  }
@@ -6924,20 +7127,28 @@ class NetworkNotFoundError extends Error {
6924
7127
  /**
6925
7128
  * Build a lookup index from a list of chains for fast repeated lookups.
6926
7129
  * Pre-computes maps keyed by chain ID, internal name, and CAIP-2 identifier.
7130
+ *
7131
+ * Non-EVM chains use the {@link NON_EVM_CHAIN_ID} (`0`) placeholder id and are
7132
+ * intentionally NOT registered in `byId` (they are not resolvable by numeric
7133
+ * id, and would otherwise all collide on `0`). They remain resolvable by
7134
+ * internal name and by their explicit CAIP-2 identifier.
6927
7135
  */
6928
7136
  function buildNetworkIndex(chains) {
6929
7137
  const byId = new Map();
6930
7138
  const byName = new Map();
6931
7139
  const byCAIP2 = new Map();
6932
7140
  for (const chain of chains) {
6933
- byId.set(chain.id, chain);
7141
+ if (chain.id !== NON_EVM_CHAIN_ID) {
7142
+ byId.set(chain.id, chain);
7143
+ }
6934
7144
  byName.set(chain.internalName, chain);
6935
- byCAIP2.set(`${chain.caip2Namespace}:${chain.id}`, chain);
7145
+ byCAIP2.set(`${chain.caip2Namespace}:${caip2Reference(chain)}`, chain);
6936
7146
  }
6937
7147
  return { byId, byName, byCAIP2 };
6938
7148
  }
6939
7149
  /**
6940
- * Look up a chain by its numeric chain ID.
7150
+ * Look up a chain by its numeric chain ID. Non-EVM chains use the
7151
+ * {@link NON_EVM_CHAIN_ID} placeholder and are not resolvable here.
6941
7152
  */
6942
7153
  function networkById$1(id, idx) {
6943
7154
  const chain = idx.byId.get(id);
@@ -6947,7 +7158,8 @@ function networkById$1(id, idx) {
6947
7158
  return chain;
6948
7159
  }
6949
7160
  /**
6950
- * Look up a chain by its internal name (e.g. "arbitrum", "mainnet").
7161
+ * Look up a chain by its internal name (e.g. "arbitrum", "mainnet",
7162
+ * "bitcoin").
6951
7163
  */
6952
7164
  function networkByName$1(name, idx) {
6953
7165
  const chain = idx.byName.get(name);
@@ -6957,7 +7169,9 @@ function networkByName$1(name, idx) {
6957
7169
  return chain;
6958
7170
  }
6959
7171
  /**
6960
- * Look up a chain by its CAIP-2 identifier string (e.g. "eip155:1").
7172
+ * Look up a chain by its CAIP-2 identifier string (e.g. "eip155:1" or
7173
+ * "bip122:000000000019d6689c085ae165831e93"). This is the way to resolve
7174
+ * non-EVM chains.
6961
7175
  */
6962
7176
  function networkByCAIP2$1(caip2, idx) {
6963
7177
  // Validate the format
@@ -6974,6 +7188,9 @@ function networkByCAIP2$1(caip2, idx) {
6974
7188
  * 2. Internal name
6975
7189
  * 3. Numeric chain ID (parsed from string)
6976
7190
  *
7191
+ * Non-EVM chains are only reachable via the CAIP-2 or internal-name paths,
7192
+ * never via the numeric-id fallback.
7193
+ *
6977
7194
  * Mirrors the Go `NetworkByString` function.
6978
7195
  */
6979
7196
  function networkByString$1(s, idx) {
@@ -7001,11 +7218,14 @@ function networkByString$1(s, idx) {
7001
7218
  }
7002
7219
  /**
7003
7220
  * Resolve a chain from an arbitrary input. Accepts:
7004
- * - `number`: treated as chain ID
7221
+ * - `number`: treated as a numeric chain ID (EVM-only)
7005
7222
  * - `string`: tried as CAIP-2 identifier (if it contains ":"), then as
7006
7223
  * internal name, then as a numeric chain ID string
7007
7224
  * - `IChainInfo`: returned directly (pass-through)
7008
7225
  *
7226
+ * Non-EVM chains have a placeholder numeric id, so they can only be resolved
7227
+ * via their CAIP-2 identifier or internal name (or passed through directly).
7228
+ *
7009
7229
  * Mirrors the Go `NetworkByAny` function.
7010
7230
  *
7011
7231
  * @throws {NetworkNotFoundError} if no matching chain is found
@@ -7079,8 +7299,29 @@ const MAINNET_CHAINS = [
7079
7299
  gensyn,
7080
7300
  pharos,
7081
7301
  ];
7082
- /** Pre-built lookup index over MAINNET_CHAINS (like Go's module-level maps). */
7083
- const _idx = buildNetworkIndex(MAINNET_CHAINS);
7302
+ /**
7303
+ * Non-EVM chains (e.g. Bitcoin). These share the {@link IChainInfo} shape as
7304
+ * EVM chains but use the `NON_EVM_CHAIN_ID` (`0`) placeholder id and are
7305
+ * resolvable only via CAIP-2 (or internal name). Kept as a separate array so
7306
+ * the EVM-only surface (and the Go codegen, which reads `MAINNET_CHAINS`) is
7307
+ * unaffected.
7308
+ */
7309
+ const NON_EVM_CHAINS = [
7310
+ bitcoin,
7311
+ ];
7312
+ /**
7313
+ * All networks, EVM and non-EVM. Use this when you need to enumerate every
7314
+ * supported chain regardless of type.
7315
+ */
7316
+ const ALL_NETWORKS = [
7317
+ ...MAINNET_CHAINS,
7318
+ ...NON_EVM_CHAINS,
7319
+ ];
7320
+ /**
7321
+ * Pre-built lookup index over all networks (EVM + non-EVM), like Go's
7322
+ * module-level maps. Resolution functions below bind to this index.
7323
+ */
7324
+ const _idx = buildNetworkIndex(ALL_NETWORKS);
7084
7325
  /**
7085
7326
  * Resolve a chain from an arbitrary input. Accepts:
7086
7327
  * - `number`: treated as chain ID
@@ -7090,14 +7331,20 @@ const _idx = buildNetworkIndex(MAINNET_CHAINS);
7090
7331
  *
7091
7332
  * Mirrors the Go `NetworkByAny` function.
7092
7333
  *
7334
+ * Non-EVM chains (e.g. Bitcoin) use a placeholder numeric id and can only be
7335
+ * resolved via their CAIP-2 identifier or internal name. Use `isNonEvmChain`
7336
+ * if you need to distinguish them.
7337
+ *
7093
7338
  * @example
7094
7339
  * ```ts
7095
7340
  * import { networkByAny } from "@gfxlabs/oku-chains";
7096
7341
  *
7097
- * networkByAny(1) // by chain ID
7342
+ * networkByAny(1) // by chain ID (EVM)
7098
7343
  * networkByAny("mainnet") // by internal name
7099
- * networkByAny("eip155:1") // by CAIP-2
7100
- * networkByAny("42161") // by chain ID string
7344
+ * networkByAny("eip155:1") // by CAIP-2 (EVM)
7345
+ * networkByAny("42161") // by chain ID string (EVM)
7346
+ * networkByAny("bip122:000000000019d6689c085ae165831e93") // by CAIP-2 (non-EVM)
7347
+ * networkByAny("bitcoin") // by internal name (non-EVM)
7101
7348
  * ```
7102
7349
  *
7103
7350
  * @throws {NetworkNotFoundError} if no matching chain is found
@@ -7106,7 +7353,8 @@ function networkByAny(v) {
7106
7353
  return networkByAny$1(v, _idx);
7107
7354
  }
7108
7355
  /**
7109
- * Look up a chain by its numeric chain ID.
7356
+ * Look up a chain by its numeric chain ID. Non-EVM chains use a placeholder id
7357
+ * and are not resolvable here.
7110
7358
  *
7111
7359
  * @throws {NetworkNotFoundError} if no matching chain is found
7112
7360
  */
@@ -7114,7 +7362,8 @@ function networkById(id) {
7114
7362
  return networkById$1(id, _idx);
7115
7363
  }
7116
7364
  /**
7117
- * Look up a chain by its internal name (e.g. "arbitrum", "mainnet").
7365
+ * Look up a chain by its internal name (e.g. "arbitrum", "mainnet",
7366
+ * "bitcoin").
7118
7367
  *
7119
7368
  * @throws {NetworkNotFoundError} if no matching chain is found
7120
7369
  */
@@ -7133,12 +7382,101 @@ function networkByString(s) {
7133
7382
  return networkByString$1(s, _idx);
7134
7383
  }
7135
7384
  /**
7136
- * Look up a chain by its CAIP-2 identifier string (e.g. "eip155:1").
7385
+ * Look up a chain by its CAIP-2 identifier string (e.g. "eip155:1" or
7386
+ * "bip122:000000000019d6689c085ae165831e93"). This is the way to resolve
7387
+ * non-EVM chains.
7137
7388
  *
7138
7389
  * @throws {NetworkNotFoundError} if no matching chain is found
7139
7390
  */
7140
7391
  function networkByCAIP2(caip2) {
7141
7392
  return networkByCAIP2$1(caip2, _idx);
7142
7393
  }
7394
+ /**
7395
+ * Resolve a {@link ChainLike} input to the chain's `caip2Namespace`. Returns
7396
+ * `""` (→ {@link ChainType.Unknown}) when the input cannot be classified.
7397
+ */
7398
+ function namespaceOfChainLike(c) {
7399
+ if (typeof c === "object") {
7400
+ return c.caip2Namespace;
7401
+ }
7402
+ if (typeof c === "string") {
7403
+ // Full CAIP-2 identifier (namespace:reference) — classify by namespace.
7404
+ const sep = c.indexOf(":");
7405
+ if (sep !== -1) {
7406
+ return c.slice(0, sep);
7407
+ }
7408
+ // Bare CAIP-2 namespace (e.g. "eip155", "bip122").
7409
+ if (Object.values(ChainType).includes(c) && c !== "") {
7410
+ return c;
7411
+ }
7412
+ // Otherwise treat as an internal name or numeric id string: resolve it.
7413
+ try {
7414
+ return networkByString$1(c, _idx).caip2Namespace;
7415
+ }
7416
+ catch {
7417
+ return "";
7418
+ }
7419
+ }
7420
+ // Numeric chain id.
7421
+ try {
7422
+ return networkById$1(Math.trunc(c), _idx).caip2Namespace;
7423
+ }
7424
+ catch {
7425
+ return "";
7426
+ }
7427
+ }
7428
+ /**
7429
+ * The {@link ChainType} of a chain. Accepts an {@link IChainInfo} object, a
7430
+ * CAIP-2 identifier or namespace string, an internal name, or a numeric chain
7431
+ * id. Internal names and numeric ids are resolved via the network index.
7432
+ *
7433
+ * @example
7434
+ * ```ts
7435
+ * import { chainType, ChainType } from "@gfxlabs/oku-chains";
7436
+ * chainType(1) // => ChainType.EVM
7437
+ * chainType("mainnet") // => ChainType.EVM
7438
+ * chainType("eip155:1") // => ChainType.EVM
7439
+ * chainType("bitcoin") // => ChainType.Bitcoin
7440
+ * chainType("bip122") // => ChainType.Bitcoin
7441
+ * ```
7442
+ */
7443
+ function chainType(c) {
7444
+ return chainType$1(namespaceOfChainLike(c));
7445
+ }
7446
+ /**
7447
+ * True if the chain belongs to the given {@link ChainType} family. Accepts an
7448
+ * {@link IChainInfo} object, a CAIP-2 identifier or namespace string, an
7449
+ * internal name, or a numeric chain id.
7450
+ *
7451
+ * Reusable, namespace-driven replacement for one-off `isBitcoinChain` style
7452
+ * checks, e.g. `isNetworkType(ChainType.Bitcoin, "bitcoin")`.
7453
+ *
7454
+ * @example
7455
+ * ```ts
7456
+ * import { isNetworkType, ChainType } from "@gfxlabs/oku-chains";
7457
+ * isNetworkType(ChainType.Bitcoin, "bitcoin") // => true
7458
+ * isNetworkType(ChainType.EVM, 1) // => true
7459
+ * isNetworkType(ChainType.EVM, "eip155:1") // => true
7460
+ * ```
7461
+ */
7462
+ function isNetworkType(type, c) {
7463
+ return isNetworkType$1(type, namespaceOfChainLike(c));
7464
+ }
7465
+ /**
7466
+ * True if the chain is an EVM chain (CAIP-2 namespace `eip155`). Accepts an
7467
+ * {@link IChainInfo} object, a CAIP-2 string, an internal name, or a numeric
7468
+ * chain id.
7469
+ */
7470
+ function isEvmChain(c) {
7471
+ return isEvmChain$1(namespaceOfChainLike(c));
7472
+ }
7473
+ /**
7474
+ * True if the chain is non-EVM (its CAIP-2 namespace is not `eip155`). Accepts
7475
+ * an {@link IChainInfo} object, a CAIP-2 string, an internal name, or a
7476
+ * numeric chain id.
7477
+ */
7478
+ function isNonEvmChain(c) {
7479
+ return isNonEvmChain$1(namespaceOfChainLike(c));
7480
+ }
7143
7481
 
7144
- export { MAINNET_CHAINS, NetworkNotFoundError, arbitrum, avalanche, base, blast, bob, boba, bsc, buildNetworkIndex, celo, corn, etherlink, filecoin, formatCAIP2, fromCAIP2, gensyn, gnosis, goat, hemi, hyperevm, lens, lightlink, linea, lisk, mainnet, manta, mantle, matchain, metal, monad, moonbeam, networkByAny, networkByCAIP2, networkById, networkByName, networkByString, nibiru, optimism, parseCAIP2, pharos, plasma, polygon, polygonZkEvm, redbelly, ronin, rootstock, saga, scroll, sei, sonic, taiko, telos, toCAIP2, tronShasta, unichain, worldchain, xdc, zerog, zkSync };
7482
+ export { ALL_NETWORKS, ChainType, MAINNET_CHAINS, NON_EVM_CHAINS, NON_EVM_CHAIN_ID, NetworkNotFoundError, arbitrum, avalanche, base, bitcoin, blast, bob, boba, bsc, buildNetworkIndex, caip2Reference, celo, chainType, corn, etherlink, filecoin, formatCAIP2, fromCAIP2, gensyn, gnosis, goat, hemi, hyperevm, isEvmChain, isNetworkType, isNonEvmChain, lens, lightlink, linea, lisk, mainnet, makeConfig, manta, mantle, matchain, metal, monad, moonbeam, networkByAny, networkByCAIP2, networkById, networkByName, networkByString, nibiru, optimism, parseCAIP2, pharos, plasma, polygon, polygonZkEvm, redbelly, ronin, rootstock, saga, scroll, sei, sonic, taiko, telos, toCAIP2, tronShasta, unichain, worldchain, xdc, zerog, zkSync };