Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Blast endpoint section #1568

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 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,27 @@ function Evm(props: NetworkProps) {
))}
</td>
</tr>
<tr>
<th>
<Admonition type='tip' title='Blast API URLs'>
<a href={'/build/blastAPI/'}>Blast API</a> provides highly scalable
fault-tolerant API endpoints.
</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 +108,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