eth/chainlist_provider.hpp¶
Namespaces¶
| Name |
|---|
| eth |
| eth::rpc |
Functions¶
| Name | |
|---|---|
| json::JsonResult< std::vector< RpcEndpointConfig > > | load_chainlist_from_json_text(std::string_view json_text) Parse chainid.network chains.json into normalized RPC endpoint configs. |
| std::vector< RpcEndpointConfig > | filter_to_configured_chains(std::vector< RpcEndpointConfig > endpoints, const std::vector< uint64_t > & configured_chain_ids) Filter endpoint configs to only those matching configured chain IDs. |
Functions Documentation¶
function load_chainlist_from_json_text¶
json::JsonResult< std::vector< RpcEndpointConfig > > load_chainlist_from_json_text(
std::string_view json_text
)
Parse chainid.network chains.json into normalized RPC endpoint configs.
Parameters:
- json_text Raw chains.json array text.
Return: Vector of RpcEndpointConfig, or JSON parse error.
Filters deprecated chains, wss:// URLs, and API-key placeholder URLs. Deduplicates by chainId + URL.
function filter_to_configured_chains¶
std::vector< RpcEndpointConfig > filter_to_configured_chains(
std::vector< RpcEndpointConfig > endpoints,
const std::vector< uint64_t > & configured_chain_ids
)
Filter endpoint configs to only those matching configured chain IDs.
Parameters:
- endpoints Endpoints to filter (consumed by move).
- configured_chain_ids Set of chain IDs that are configured/provisioned.
Return: Filtered endpoints (only configured chains remain).
Source code¶
// Copyright 2026 Genius Ventures, Inc.
// SPDX-License-Identifier: MIT
#ifndef EVMRELAY_INCLUDE_ETH_CHAINLIST_PROVIDER_HPP
#define EVMRELAY_INCLUDE_ETH_CHAINLIST_PROVIDER_HPP
#include <eth/rpc_manager_config.hpp>
#include <base/json_utility.hpp>
#include <cstdint>
#include <string_view>
#include <vector>
namespace eth::rpc {
[[nodiscard]] rlp::base::json::JsonResult<std::vector<RpcEndpointConfig>> load_chainlist_from_json_text(
std::string_view json_text);
[[nodiscard]] std::vector<RpcEndpointConfig> filter_to_configured_chains(
std::vector<RpcEndpointConfig> endpoints,
const std::vector<uint64_t>& configured_chain_ids);
} // namespace eth::rpc
#endif // EVMRELAY_INCLUDE_ETH_CHAINLIST_PROVIDER_HPP
Updated on 2026-06-05 at 17:22:19 -0700