Skip to content

Commit

Permalink
Added extended rpc api support to table
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathbabu-moralis committed Oct 30, 2024
1 parent e0593ff commit 91ad369
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 61 deletions.
8 changes: 8 additions & 0 deletions docs/07-rpc-nodes/reference/04-arbitrum-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ slug: "/rpc-nodes/arbitrum-json-rpc-api"
sidebar_position: 3
---

import Admonition from "@theme/Admonition";

# Arbitrum JSON RPC API

## Introduction
Expand Down Expand Up @@ -59,6 +61,12 @@ The Arbitrum RPC API is available for the following networks:

## Supported Extended RPC Methods

<Admonition type="note" title="Network Support Notice">
<p>
The Extended RPC APIs are only supported on the <b>Arbitrum</b> Mainnet.
</p>
</Admonition>

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
Expand Down
8 changes: 8 additions & 0 deletions docs/07-rpc-nodes/reference/06-optimism-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ slug: "/rpc-nodes/optimism-json-rpc-api"
sidebar_position: 5
---

import Admonition from "@theme/Admonition";

# Optimism JSON RPC API

## Introduction
Expand Down Expand Up @@ -59,6 +61,12 @@ The Optimism RPC API is available for the following networks:

## Supported Extended RPC Methods

<Admonition type="note" title="Network Support Notice">
<p>
The Extended RPC APIs are only supported on the <b>Optimism</b> Mainnet.
</p>
</Admonition>

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
Expand Down
10 changes: 0 additions & 10 deletions docs/07-rpc-nodes/reference/11-blast-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,3 @@ The Blast RPC API is available for the following networks:
- [eth_getUncleCountByBlockNumber](/rpc-nodes/reference/eth_getUncleCountByBlockNumber)
- [eth_maxPriorityFeePerGas](/rpc-nodes/reference/eth_maxPriorityFeePerGas)
- [eth_sendRawTransaction](/rpc-nodes/reference/eth_sendRawTransaction)

## Supported Extended RPC Methods

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
- [eth_getTokenPrice](/rpc-nodes/reference/extended-rpc/eth_getTokenPrice)
- [eth_getTokenMetadata](/rpc-nodes/reference/extended-rpc/eth_getTokenMetadata)
- [eth_getNFTBalances](/rpc-nodes/reference/extended-rpc/eth_getNFTBalances)
- [eth_getNFTCollections](/rpc-nodes/reference/extended-rpc/eth_getNFTCollections)
10 changes: 0 additions & 10 deletions docs/07-rpc-nodes/reference/12-zksync-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,3 @@ The zkSync RPC API is available for the following networks:
- [eth_getUncleCountByBlockNumber](/rpc-nodes/reference/eth_getUncleCountByBlockNumber)
- [eth_maxPriorityFeePerGas](/rpc-nodes/reference/eth_maxPriorityFeePerGas)
- [eth_sendRawTransaction](/rpc-nodes/reference/eth_sendRawTransaction)

## Supported Extended RPC Methods

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
- [eth_getTokenPrice](/rpc-nodes/reference/extended-rpc/eth_getTokenPrice)
- [eth_getTokenMetadata](/rpc-nodes/reference/extended-rpc/eth_getTokenMetadata)
- [eth_getNFTBalances](/rpc-nodes/reference/extended-rpc/eth_getNFTBalances)
- [eth_getNFTCollections](/rpc-nodes/reference/extended-rpc/eth_getNFTCollections)
10 changes: 0 additions & 10 deletions docs/07-rpc-nodes/reference/13-mantle-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,3 @@ The Mantle RPC API is available for the following networks:
- [eth_getUncleCountByBlockNumber](/rpc-nodes/reference/eth_getUncleCountByBlockNumber)
- [eth_maxPriorityFeePerGas](/rpc-nodes/reference/eth_maxPriorityFeePerGas)
- [eth_sendRawTransaction](/rpc-nodes/reference/eth_sendRawTransaction)

## Supported Extended RPC Methods

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
- [eth_getTokenPrice](/rpc-nodes/reference/extended-rpc/eth_getTokenPrice)
- [eth_getTokenMetadata](/rpc-nodes/reference/extended-rpc/eth_getTokenMetadata)
- [eth_getNFTBalances](/rpc-nodes/reference/extended-rpc/eth_getNFTBalances)
- [eth_getNFTCollections](/rpc-nodes/reference/extended-rpc/eth_getNFTCollections)
10 changes: 0 additions & 10 deletions docs/07-rpc-nodes/reference/13-opBNB-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,3 @@ The opBNB RPC API is available for the following network:
- [eth_getUncleCountByBlockNumber](/rpc-nodes/reference/eth_getUncleCountByBlockNumber)
- [eth_maxPriorityFeePerGas](/rpc-nodes/reference/eth_maxPriorityFeePerGas)
- [eth_sendRawTransaction](/rpc-nodes/reference/eth_sendRawTransaction)

## Supported Extended RPC Methods

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
- [eth_getTokenPrice](/rpc-nodes/reference/extended-rpc/eth_getTokenPrice)
- [eth_getTokenMetadata](/rpc-nodes/reference/extended-rpc/eth_getTokenMetadata)
- [eth_getNFTBalances](/rpc-nodes/reference/extended-rpc/eth_getNFTBalances)
- [eth_getNFTCollections](/rpc-nodes/reference/extended-rpc/eth_getNFTCollections)
10 changes: 0 additions & 10 deletions docs/07-rpc-nodes/reference/14-polygon-zkevm-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,3 @@ The Polygon zkEVM RPC API is available for the following networks:
- [eth_getUncleCountByBlockNumber](/rpc-nodes/reference/eth_getUncleCountByBlockNumber)
- [eth_maxPriorityFeePerGas](/rpc-nodes/reference/eth_maxPriorityFeePerGas)
- [eth_sendRawTransaction](/rpc-nodes/reference/eth_sendRawTransaction)

## Supported Extended RPC Methods

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
- [eth_getTokenPrice](/rpc-nodes/reference/extended-rpc/eth_getTokenPrice)
- [eth_getTokenMetadata](/rpc-nodes/reference/extended-rpc/eth_getTokenMetadata)
- [eth_getNFTBalances](/rpc-nodes/reference/extended-rpc/eth_getNFTBalances)
- [eth_getNFTCollections](/rpc-nodes/reference/extended-rpc/eth_getNFTCollections)
10 changes: 0 additions & 10 deletions docs/07-rpc-nodes/reference/15-zetachain-json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,3 @@ The Zetachain RPC API is available for the following networks:
- [eth_getUncleCountByBlockNumber](/rpc-nodes/reference/eth_getUncleCountByBlockNumber)
- [eth_maxPriorityFeePerGas](/rpc-nodes/reference/eth_maxPriorityFeePerGas)
- [eth_sendRawTransaction](/rpc-nodes/reference/eth_sendRawTransaction)

## Supported Extended RPC Methods

- [eth_getTransactions](/rpc-nodes/reference/extended-rpc/eth_getTransactions)
- [eth_getDecodedTransactions](/rpc-nodes/reference/extended-rpc/eth_getDecodedTransactions)
- [eth_getTokenBalances](/rpc-nodes/reference/extended-rpc/eth_getTokenBalances)
- [eth_getTokenPrice](/rpc-nodes/reference/extended-rpc/eth_getTokenPrice)
- [eth_getTokenMetadata](/rpc-nodes/reference/extended-rpc/eth_getTokenMetadata)
- [eth_getNFTBalances](/rpc-nodes/reference/extended-rpc/eth_getNFTBalances)
- [eth_getNFTCollections](/rpc-nodes/reference/extended-rpc/eth_getNFTCollections)
12 changes: 12 additions & 0 deletions src/components/SupportedChains/EVM/combined/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const serviceHeaders = {
streamsapi: { key: "streamsApi", label: "Streams API" },
authapi: { key: "authApi", label: "Auth API" },
rpc: { key: "rpcNodes", label: "RPC Nodes" },
extendedrpc: { key: "extendedRpcApi", label: "Extended RPC API" },
};

const allHeaders = [
Expand All @@ -45,6 +46,7 @@ const allHeaders = [
{ key: "streamsApi", label: "Streams API" },
{ key: "authApi", label: "Auth API" },
{ key: "rpcNodes", label: "RPC Nodes" },
{ key: "extendedRpcApi", label: "Extended RPC API" },
];

const EVMChainsCombined = () => {
Expand Down Expand Up @@ -73,6 +75,15 @@ const EVMChainsCombined = () => {

const getFilteredData = () => {
if (!service) return chainData;

// Check if both rpcNodes and evmApi are supported for 'extendedrpc' service
if (service === "extendedrpc") {
return chainData.filter(
(chain) => chain.rpcNodes?.supported && chain.evmApi?.supported
);
}

// Default filter for other services
return chainData.filter(
(chain) => chain[serviceHeaders[service].key]?.supported
);
Expand Down Expand Up @@ -112,6 +123,7 @@ const EVMChainsCombined = () => {
<option value="streamsapi">Streams API</option>
<option value="authapi">Auth API</option>
<option value="rpc">RPC Nodes</option>
<option value="extendedrpc">Extended RPC API</option>
</select>
)}
<GenericTable data={getFilteredData()} headers={getHeaders()} />
Expand Down
8 changes: 8 additions & 0 deletions src/components/SupportedChains/Utils/ChainTableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ const TableCell = ({ header, rowData }) => {
) : (
<span>No URLs Available</span>
);
} else if (header === "extendedRpcApi") {
const isSupported =
rowData.evmApi?.supported && rowData.rpcNodes?.supported;
return isSupported ? (
<SupportedIcon />
) : (
<UnsupportedIcon reason="Unsupported" />
);
} else if (["evmApi", "streamsApi", "rpcNodes", "authApi"].includes(header)) {
const { supported, reason } = rowData[header];
return supported ? <SupportedIcon /> : <UnsupportedIcon reason={reason} />;
Expand Down
8 changes: 7 additions & 1 deletion src/components/SupportedChains/Utils/ChainTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ const TableRow = ({ rowData, headers }) => (
{headers.map((header, index) => (
<td
style={
["evmApi", "streamsApi", "rpcNodes", "authApi"].includes(header)
[
"evmApi",
"streamsApi",
"rpcNodes",
"authApi",
"extendedRpcApi",
].includes(header)
? { textAlign: "center" }
: {}
}
Expand Down

0 comments on commit 91ad369

Please sign in to comment.