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

Split metaport config #464

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Split metaport config #464

wants to merge 7 commits into from

Conversation

dmytrotkk
Copy link
Contributor

In this PR:

  • Update metaport config structure
  • Split configs for all mainnet hubs

Copy link

vercel bot commented Feb 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 5:32pm

@dmytrotkk dmytrotkk self-assigned this Feb 18, 2025
@dmytrotkk dmytrotkk linked an issue Feb 18, 2025 that may be closed by this pull request
TheGreatAxios
TheGreatAxios previously approved these changes Feb 21, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

Should testnet hubs also be split into multiple config files?

@@ -73,7 +68,7 @@ export abstract class StepMetadata {
public type: ActionType,
public from: string,
public to: string
) {}
) { }
Copy link
Contributor

Choose a reason for hiding this comment

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

Necessary space?

export interface TxOpts {
value?: BigNumberish
address: string
privateKey?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not used anymore, removed


import WidgetUI from '../WidgetUI'
import Debug from '../Debug'
import MetaportProvider from '../MetaportProvider'

export default function Metaport(props: { config: MetaportConfig }) {
export default function Metaport(props: { config: types.mp.Config }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note -> not a huge fan of the broad imports like import { types } -> why? adds a ton of chained complexity even though it feels more declarative. Have found its often more clear to do

import { type Config } from '@/core/config` for exmaple

import { useWalletClient, useSwitchChain } from 'wagmi'
import { MainnetChain, SChain } from '@skalenetwork/ima-js'
import { dc, constants } from '@/core'
Copy link
Contributor

Choose a reason for hiding this comment

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

what is dc? Would prefer to see that be a bit more declarative

@@ -32,13 +33,13 @@ import ContentCopyIcon from '@mui/icons-material/ContentCopy'
import { styled } from '@mui/material/styles'
import Switch from '@mui/material/Switch'

import { cmn, cls, styles, type interfaces } from '@skalenetwork/metaport'
import { cmn, cls, styles } from '@skalenetwork/metaport'

export default function CopySurface(props: {
title: string
value: string | null | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

value should not be null ever, only string | undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

color?: DueDateStatus
progressColor?: DueDateStatus
color?: types.pm.DueDateStatus
progressColor?: types.pm.DueDateStatus
progress?: number
children?: ReactElement | ReactElement[] | false
childrenRi?: ReactElement | ReactElement[] | null | ''
Copy link
Contributor

Choose a reason for hiding this comment

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

replace null with undefined

Comment on lines 27 to 28
import { dc, constants, units } from '@/core'
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer declarative naming for dc


import { CopyToClipboard } from 'react-copy-to-clipboard'
import Tooltip from '@mui/material/Tooltip'
import ButtonBase from '@mui/material/ButtonBase'
import CheckCircleRoundedIcon from '@mui/icons-material/CheckCircleRounded'
import UnfoldMoreRoundedIcon from '@mui/icons-material/UnfoldMoreRounded'

import { DEFAULT_ERC20_DECIMALS } from '../core/constants'

export default function TokenSurface(props: {
title: string
value: string | null | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove type null from value if possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -33,29 +32,29 @@ import {
} from '.'

export async function getStakingInfoMap(
Copy link
Contributor

Choose a reason for hiding this comment

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

Switch uses of null -> undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split metaport config - one chain per file Change Default Token on Bridge
3 participants