Skip to content

Commit

Permalink
changes according to V4
Browse files Browse the repository at this point in the history
  • Loading branch information
D4mph1r committed Sep 5, 2024
1 parent 9081948 commit 9f23157
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/components/ExplorerEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export interface IEvent {
toHash?: string;
senderAddress: string;
targetAddress?: string;
createdWith?: string;
createdAt: Date;
nftUri: string;
imgUri?: string;
Expand Down Expand Up @@ -126,7 +127,7 @@ export const ExplorerEvents: FC<{ status?: string }> = ({ status = "" }) => {

const getExchangeRate = (
rates: { [key: string]: { usd: number } },
chainName: string
chainName?: string
): number => {
const chain = chains.find(
(chain) => chain?.name?.toLowerCase() === chainName?.toLowerCase()
Expand Down Expand Up @@ -254,10 +255,11 @@ export const ExplorerEvents: FC<{ status?: string }> = ({ status = "" }) => {
eventsContext?.events.length ? (
eventsContext?.events.map(
(event: IEvent, idx: number) => {
const chainName = event?.createdWith === "v4" ? event?.toChainName : event?.chainName;
const dollarValue =
getExchangeRate(
exchangeRates,
event?.chainName
chainName
) * formatFees(event);

const fees = formatFees(event);
Expand Down Expand Up @@ -300,15 +302,20 @@ export const ExplorerEvents: FC<{ status?: string }> = ({ status = "" }) => {
data-tip={`${formatFees(
event
)} ${
event.fromChain &&
event?.createdWith === "v4" ? event.toChain && currency[
event.toChain
] : event.fromChain &&
currency[
event.fromChain
event
.fromChain
]
} <br>${dollarValue} $`}
>
<span>{fixedFees}</span>{" "}
<span>
{event.fromChain &&
{event?.createdWith === "v4" ? event.toChain && currency[
event.toChain
] : event.fromChain &&
currency[
event
.fromChain
Expand Down

0 comments on commit 9f23157

Please sign in to comment.