From 5cb856b8a8a84303dd7adc7b4f8f7a673889e878 Mon Sep 17 00:00:00 2001 From: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> Date: Tue, 4 Jun 2024 06:39:13 -0300 Subject: [PATCH] Update and add endpoints --- src/theme/NetworkInfo/index.tsx | 54 ++++++++++++++++++++++----------- src/theme/constant.tsx | 53 ++++++++++++++++++++++++-------- 2 files changed, 77 insertions(+), 30 deletions(-) diff --git a/src/theme/NetworkInfo/index.tsx b/src/theme/NetworkInfo/index.tsx index c430b8c8129..3cf243df9f0 100644 --- a/src/theme/NetworkInfo/index.tsx +++ b/src/theme/NetworkInfo/index.tsx @@ -19,31 +19,31 @@ function L1(props: NetworkProps) { HTTP REST API - -

{props.httpRestApi}

-
+ {props.httpRestApi} Event API - {props.eventApi} + + {props.eventApi} + Permanode API - - {props.permaNodeApi} - + {props.permaNodeApi} + {props.faucet && ( + + Faucet + + + {props.faucet} + + + + )} ); @@ -75,7 +75,7 @@ function Evm(props: NetworkProps) { ))} - {props.evm.blastApiUrls && ( + {props.evmCustom.blastApiUrls && ( @@ -84,7 +84,7 @@ function Evm(props: NetworkProps) { - {props.evm.blastApiUrls.map((object, index) => + {props.evmCustom.blastApiUrls.map((object, index) => typeof object === 'string' ? ( {object as string} ) : ( @@ -109,6 +109,26 @@ function Evm(props: NetworkProps) { + + + {props.evmCustom.toolkit.hasFaucet ? 'Toolkit & Faucet' : 'Toolkit'} + + + + {props.evmCustom.toolkit.url} + + + + + WASP API + + {props.evmCustom.api} + + ); diff --git a/src/theme/constant.tsx b/src/theme/constant.tsx index 114053c14a8..78099fb9e73 100644 --- a/src/theme/constant.tsx +++ b/src/theme/constant.tsx @@ -19,6 +19,12 @@ export const Networks = { 'wss://ws.json-rpc.evm.iotaledger.net', ], blockExplorerUrls: ['https://explorer.evm.iota.org'], + }, + evmCustom: { + chainAddress: + 'iota1pzt3mstq6khgc3tl0mwuzk3eqddkryqnpdxmk4nr25re2466uxwm28qqxu5', + aliasId: + '0x971dc160d5ae8c457f7eddc15a39035b6190130b4dbb5663550795575ae19db5', blastApiUrls: [ 'https://iota-mainnet-evm.public.blastapi.io', 'wss://iota-mainnet-evm.public.blastapi.io', @@ -27,12 +33,11 @@ export const Networks = { 'https://iota-mainnet-evm.blastapi.io/e7596858-fc63-4a54-8727-b885a2af4ec8', }, ], - }, - evmCustom: { - chainAddress: - 'iota1pzt3mstq6khgc3tl0mwuzk3eqddkryqnpdxmk4nr25re2466uxwm28qqxu5', - aliasId: - '0x971dc160d5ae8c457f7eddc15a39035b6190130b4dbb5663550795575ae19db5', + toolkit: { + url: 'https://evm-toolkit.evm.iotaledger.net', + hasFaucet: false, + }, + api: 'https://api.evm.iotaledger.net', }, }, iota_2_testnet: { @@ -65,6 +70,12 @@ export const Networks = { 'wss://ws.json-rpc.evm.testnet.iotaledger.net', ], blockExplorerUrls: ['https://explorer.evm.testnet.iotaledger.net'], + }, + evmCustom: { + chainAddress: + 'tst1pzxsrr7apqkdzz633dyntmvxwtyvk029p39te5j0m33q6946h7akzv663zu', + aliasId: + '0x8d018fdd082cd10b518b4935ed8672c8cb3d450c4abcd24fdc620d16babfbb61', blastApiUrls: [ 'https://iota-testnet-evm.public.blastapi.io', 'wss://iota-testnet-evm.public.blastapi.io', @@ -73,12 +84,11 @@ export const Networks = { 'https://iota-testnet-evm.blastapi.io/e7596858-fc63-4a54-8727-b885a2af4ec8', }, ], - }, - evmCustom: { - chainAddress: - 'tst1pzxsrr7apqkdzz633dyntmvxwtyvk029p39te5j0m33q6946h7akzv663zu', - aliasId: - '0x8d018fdd082cd10b518b4935ed8672c8cb3d450c4abcd24fdc620d16babfbb61', + toolkit: { + url: 'https://evm-toolkit.evm.testnet.iotaledger.net', + hasFaucet: false, + }, + api: 'https://api.evm.testnet.iotaledger.net', }, }, shimmer: { @@ -107,6 +117,11 @@ export const Networks = { 'smr1prxvwqvwf7nru5q5xvh5thwg54zsm2y4wfnk6yk56hj3exxkg92mx20wl3s', aliasId: '0xccc7018e4fa63e5014332f45ddc8a5450da89572676d12d4d5e51c98d64155b3', + toolkit: { + url: 'https://evm-toolkit.evm.shimmer.network', + hasFaucet: false, + }, + api: 'https://api.evm.shimmer.network', }, }, shimmer_testnet: { @@ -133,10 +148,20 @@ export const Networks = { 'rms1ppp00k5mmd2m8my8ukkp58nd3rskw6rx8l09aj35984k74uuc5u2cywn3ex', aliasId: '0x42f7da9bdb55b3ec87e5ac1a1e6d88e16768663fde5eca3429eb6f579cc538ac', + toolkit: { + url: 'https://evm-toolkit.evm.testnet.shimmer.network', + hasFaucet: true, + }, + api: 'https://api.evm.testnet.shimmer.network', }, }, }; +export interface Toolkit { + url: string; + hasFaucet: boolean; +} + export interface AddEthereumChainParameter { chainId: string; // A 0x-prefixed hexadecimal string chainName: string; @@ -146,7 +171,6 @@ export interface AddEthereumChainParameter { decimals: number; }; rpcUrls?: string[]; - blastApiUrls?: Array; blockExplorerUrls?: string[]; iconUrls?: string[]; // Currently ignored. } @@ -163,5 +187,8 @@ export interface NetworkProps { evmCustom: { chainAddress: string; aliasId: string; + blastApiUrls?: Array; + toolkit?: Toolkit; + api?: string; }; }