Skip to content
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
1 change: 1 addition & 0 deletions src/components/CCIP/Chain/ChainTokenGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function ChainTokenGrid({ tokens, network, environment }: ChainTokenGridProps) {
tokenDecimals: data[key].decimals,
tokenAddress: data[key].tokenAddress,
tokenPoolType: (data[key].pool?.type || data[key].poolType) as PoolType,
tokenPoolRawType: data[key].pool?.rawType || "",
tokenPoolAddress: data[key].pool?.address || data[key].poolAddress || "",
tokenPoolVersion: data[key].pool?.version || "",
explorer: network.explorer,
Expand Down
4 changes: 2 additions & 2 deletions src/components/CCIP/ChainHero/TokenDetailsHero.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Address from "~/components/AddressReact.tsx"
import { getExplorerAddressUrl, fallbackTokenIconUrl } from "~/features/utils/index.ts"
import { PoolType } from "~/config/data/ccip/types.ts"
import { tokenPoolDisplay } from "~/config/data/ccip/utils.ts"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual method was not removed! Please remove it as it is unused

import "./ChainHero.css"
import { ExplorerInfo, ChainType } from "~/config/types.ts"
import { getNetworkIconUrl } from "~/config/data/ccip/data.ts"
Expand All @@ -21,6 +20,7 @@ interface TokenDetailsHeroProps {
decimals: number
address: string
poolType: PoolType
poolRawType: string
poolAddress: string
}
inDrawer?: boolean
Expand Down Expand Up @@ -69,7 +69,7 @@ function TokenDetailsHero({ network, token, inDrawer = false }: TokenDetailsHero
</div>
<div className="ccip-chain-hero__details__item">
<div className="ccip-chain-hero__details__label">Token pool type</div>
<div className="ccip-chain-hero__details__value">{tokenPoolDisplay(token.poolType)}</div>
<div className="ccip-chain-hero__details__value">{token.poolRawType}</div>
</div>
<div className="ccip-chain-hero__details__item">
<div className="ccip-chain-hero__details__label">Token pool address</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/CCIP/Drawer/TokenDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function TokenDrawer({
tokenDecimals: number
tokenAddress: string
tokenPoolType: PoolType
tokenPoolRawType: string
tokenPoolAddress: string
explorer: ExplorerInfo
}
Expand Down Expand Up @@ -174,6 +175,7 @@ function TokenDrawer({
decimals: network.tokenDecimals,
address: network.tokenAddress,
poolType: network.tokenPoolType,
poolRawType: network.tokenPoolRawType,
poolAddress: network.tokenPoolAddress,
}}
network={{
Expand Down
5 changes: 3 additions & 2 deletions src/components/CCIP/Tables/TokenChainsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Address from "~/components/AddressReact.tsx"
import "./Table.css"
import { drawerContentStore, DrawerWidth, drawerWidthStore } from "../Drawer/drawerStore.ts"
import { Environment, SupportedTokenConfig, tokenPoolDisplay, PoolType } from "~/config/data/ccip/index.ts"
import { Environment, SupportedTokenConfig, PoolType } from "~/config/data/ccip/index.ts"
import { areAllLanesPaused } from "~/config/data/ccip/utils.ts"
import { ChainType, ExplorerInfo } from "~/config/types.ts"
import TableSearchInput from "./TableSearchInput.tsx"
Expand All @@ -24,6 +24,7 @@ interface TableProps {
tokenDecimals: number
tokenAddress: string
tokenPoolType: PoolType
tokenPoolRawType: string
tokenPoolAddress: string
tokenPoolVersion: string
explorer: ExplorerInfo
Expand Down Expand Up @@ -139,7 +140,7 @@ function TokenChainsTable({ networks, token, lanes, environment }: TableProps) {
endLength={4}
/>
</td>
<td>{tokenPoolDisplay(network.tokenPoolType)}</td>
<td>{network.tokenPoolRawType}</td>
<td data-clipboard-type="token-pool">
<Address
contractUrl={getExplorerAddressUrl(
Expand Down
3 changes: 2 additions & 1 deletion src/components/CCIP/Token/Token.astro
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ const tokenStructuredData = generateTokenStructuredData(token, environment, chai
tokenDecimals: data[key]?.decimals ?? 0,
tokenAddress: data[key]?.tokenAddress ?? "",
tokenPoolType: data[key]?.pool?.type,
tokenPoolAddress: data[key]?.pool?.address ?? "",
tokenPoolRawType: data[key]?.pool?.rawType || "",
tokenPoolAddress: data[key]?.pool?.address ?? data[key]?.poolAddress ?? "",
tokenPoolVersion: data[key]?.pool?.version ?? "",
explorer: explorer,
chainType: chainType,
Expand Down
11 changes: 0 additions & 11 deletions src/config/data/ccip/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ export const determineTokenMechanism = (
return POOL_MECHANISM_MAP[key] ?? TokenMechanism.Unsupported
}

export const tokenPoolDisplay = (poolType?: PoolType) => {
const poolTypeMapping: Record<PoolType, string> = {
lockRelease: "LockRelease",
burnMint: "BurnMint",
usdc: "BurnMint",
feeTokenOnly: "Fee Token Only",
}

return poolType ? (poolTypeMapping[poolType] ?? "Unsupported") : "Unsupported"
}

export const calculateNetworkFeesForTokenMechanismDirect = (
mechanism: TokenMechanism,
laneSpecificFeeKey: LaneSpecificFeeKey
Expand Down
Loading