Skip to content

Commit

Permalink
Refactor Blast endpoint section
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Electron committed May 21, 2024
1 parent ce58105 commit 1bb00a8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 24 deletions.
35 changes: 24 additions & 11 deletions theme/src/theme/NetworkInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { ChainId } from '../ChainId';
import { NetworkProps } from '../constant';
import CodeBlock from '@theme/CodeBlock';
import Admonition from '@theme/Admonition';

function L1(props: NetworkProps) {
return (
Expand Down Expand Up @@ -74,6 +75,29 @@ function Evm(props: NetworkProps) {
))}
</td>
</tr>
<tr>
<th>
<Admonition type='tip' title='Blast API URLs'>
This are highly scalable and fault-tolerant API endpoints provided
by our partner Blast. You can find more information about Blast
and how to apply for special Blast API endpoints{' '}
<a href={'/build/blastAPI/'}>here</a>.
</Admonition>
</th>
<td>
{props.evm.blastApiUrls &&
props.evm.blastApiUrls.map((object, index) =>
typeof object === 'string' ? (
<CodeBlock> {object as string} </CodeBlock>
) : (
<CodeBlock title={Object.keys(object)[0]}>
{' '}
{Object.values(object)[0]}{' '}
</CodeBlock>
),
)}
</td>
</tr>
<tr>
<th>Explorer</th>
<td>
Expand All @@ -86,17 +110,6 @@ function Evm(props: NetworkProps) {
</a>
</td>
</tr>
{props.evm.BlastAPIUrls &&
Object.keys(props.evm.BlastAPIUrls).map((keyName, index) => (
<tr key={index}>
<th>
<a href={'/build/blastAPI/'}>Blast API</a> {keyName} URL
</th>
<td>
<CodeBlock> {props.evm.BlastAPIUrls[keyName]} </CodeBlock>
</td>
</tr>
))}
</tbody>
</table>
);
Expand Down
30 changes: 17 additions & 13 deletions theme/src/theme/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ export const Networks = {
'wss://ws.json-rpc.evm.iotaledger.net',
],
blockExplorerUrls: ['https://explorer.evm.iota.org'],
BlastAPIUrls: {
RPC: 'https://iota-mainnet-evm.public.blastapi.io',
WSS: 'wss://iota-mainnet-evm.public.blastapi.io',
'Archive RPC':
'https://iota-mainnet-evm.blastapi.io/e7596858-fc63-4a54-8727-b885a2af4ec8',
},
blastApiUrls: [
'https://iota-mainnet-evm.public.blastapi.io',
'wss://iota-mainnet-evm.public.blastapi.io',
{
'Archive RPC':
'https://iota-mainnet-evm.blastapi.io/e7596858-fc63-4a54-8727-b885a2af4ec8',
},
],
},
evmCustom: {
chainAddress:
Expand Down Expand Up @@ -63,12 +65,14 @@ export const Networks = {
'wss://ws.json-rpc.evm.testnet.iotaledger.net',
],
blockExplorerUrls: ['https://explorer.evm.testnet.iotaledger.net'],
BlastAPIUrls: {
RPC: 'https://iota-testnet-evm.public.blastapi.io',
WSS: 'wss://iota-testnet-evm.public.blastapi.io',
'Archive RPC':
'https://iota-testnet-evm.blastapi.io/e7596858-fc63-4a54-8727-b885a2af4ec8',
},
blastApiUrls: [
'https://iota-testnet-evm.public.blastapi.io',
'wss://iota-testnet-evm.public.blastapi.io',
{
'Archive RPC':
'https://iota-testnet-evm.blastapi.io/e7596858-fc63-4a54-8727-b885a2af4ec8',
},
],
},
evmCustom: {
chainAddress:
Expand Down Expand Up @@ -142,7 +146,7 @@ export interface AddEthereumChainParameter {
decimals: number;
};
rpcUrls?: string[];
BlastAPIUrls?: object;
blastApiUrls?: Array<string | object>;
blockExplorerUrls?: string[];
iconUrls?: string[]; // Currently ignored.
}
Expand Down

0 comments on commit 1bb00a8

Please sign in to comment.