From 1bb00a86b3511e7f3388b7533ce7740fa099427d Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Tue, 21 May 2024 23:51:05 +0200 Subject: [PATCH 1/2] Refactor Blast endpoint section --- theme/src/theme/NetworkInfo/index.tsx | 35 ++++++++++++++++++--------- theme/src/theme/constant.tsx | 30 +++++++++++++---------- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/theme/src/theme/NetworkInfo/index.tsx b/theme/src/theme/NetworkInfo/index.tsx index 83ab3cd3ba5..bf03a0954fc 100644 --- a/theme/src/theme/NetworkInfo/index.tsx +++ b/theme/src/theme/NetworkInfo/index.tsx @@ -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 ( @@ -74,6 +75,29 @@ function Evm(props: NetworkProps) { ))} + + + + 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{' '} + here. + + + + {props.evm.blastApiUrls && + props.evm.blastApiUrls.map((object, index) => + typeof object === 'string' ? ( + {object as string} + ) : ( + + {' '} + {Object.values(object)[0]}{' '} + + ), + )} + + Explorer @@ -86,17 +110,6 @@ function Evm(props: NetworkProps) { - {props.evm.BlastAPIUrls && - Object.keys(props.evm.BlastAPIUrls).map((keyName, index) => ( - - - Blast API {keyName} URL - - - {props.evm.BlastAPIUrls[keyName]} - - - ))} ); diff --git a/theme/src/theme/constant.tsx b/theme/src/theme/constant.tsx index 8784f754c03..114053c14a8 100644 --- a/theme/src/theme/constant.tsx +++ b/theme/src/theme/constant.tsx @@ -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: @@ -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: @@ -142,7 +146,7 @@ export interface AddEthereumChainParameter { decimals: number; }; rpcUrls?: string[]; - BlastAPIUrls?: object; + blastApiUrls?: Array; blockExplorerUrls?: string[]; iconUrls?: string[]; // Currently ignored. } From ae6ac05e3e39e97236ab282e1a1dadac995e8ace Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Wed, 22 May 2024 23:30:14 +0200 Subject: [PATCH 2/2] Update theme/src/theme/NetworkInfo/index.tsx Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> --- theme/src/theme/NetworkInfo/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/theme/src/theme/NetworkInfo/index.tsx b/theme/src/theme/NetworkInfo/index.tsx index bf03a0954fc..4f6fc580bd1 100644 --- a/theme/src/theme/NetworkInfo/index.tsx +++ b/theme/src/theme/NetworkInfo/index.tsx @@ -78,10 +78,8 @@ function Evm(props: NetworkProps) { - 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{' '} - here. + Blast API provides highly scalable + fault-tolerant API endpoints.