diff --git a/apps/portal/codegen.crowdloan.ts b/apps/portal/codegen.crowdloan.ts
deleted file mode 100644
index 9b996698c..000000000
--- a/apps/portal/codegen.crowdloan.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { CodegenConfig } from '@graphql-codegen/cli'
-
-const config: CodegenConfig = {
- overwrite: true,
- schema: process.env.VITE_DOT_CROWDLOAN_INDEXER,
- documents: ['src/libs/crowdloans/useCrowdloanContributions.ts'],
- generates: {
- 'src/generated/gql/crowdloan/gql/': {
- preset: 'client',
- plugins: [],
- config: {
- useTypeImports: true,
- },
- },
- },
-}
-
-export default config
diff --git a/apps/portal/codegen.history.ts b/apps/portal/codegen.history.ts
deleted file mode 100644
index cd687ec35..000000000
--- a/apps/portal/codegen.history.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { CodegenConfig } from '@graphql-codegen/cli'
-
-const config: CodegenConfig = {
- overwrite: true,
- schema: process.env.VITE_EX_HISTORY_INDEXER,
- documents: ['src/components/widgets/history/**/*.tsx', 'src/routes/history.tsx'],
- generates: {
- 'src/generated/gql/extrinsicHistory/gql/': {
- preset: 'client',
- plugins: [],
- config: {
- useTypeImports: true,
- },
- },
- },
-}
-
-export default config
diff --git a/apps/portal/package.json b/apps/portal/package.json
index 4d803f816..04be9c6eb 100644
--- a/apps/portal/package.json
+++ b/apps/portal/package.json
@@ -15,8 +15,6 @@
"e2e": "playwright test",
"storybook": "storybook dev -p 6008",
"build-storybook": "storybook build",
- "codegen:history": "graphql-codegen --require dotenv/config --config codegen.history.ts",
- "codegen:crowdloan": "graphql-codegen --require dotenv/config --config codegen.crowdloan.ts",
"codegen:nova": "graphql-codegen --require dotenv/config --config codegen.nova.ts"
},
"dependencies": {
@@ -79,7 +77,6 @@
"react-use": "^17.4.0",
"react-winbox": "^1.5.0",
"recoil": "^0.7.7",
- "safety-match": "^0.4.4",
"scale-ts": "^1.6.0",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
diff --git a/apps/portal/src/App.tsx b/apps/portal/src/App.tsx
index 0eccfba77..389fd6f78 100644
--- a/apps/portal/src/App.tsx
+++ b/apps/portal/src/App.tsx
@@ -3,6 +3,7 @@ import '@polkadot/api-augment/substrate'
import '@talismn/astar-types/augment-api'
import '@talismn/astar-types/types-lookup'
+import { BalancesProvider } from '@talismn/balances-react'
import { PolkadotApiProvider } from '@talismn/react-polkadot-api'
import { Toaster } from '@talismn/ui/molecules/Toaster'
import { PostHogProvider } from 'posthog-js/react'
@@ -21,8 +22,6 @@ import { chainDeriveState, chainQueryMultiState, chainQueryState } from '@/domai
import { ExtensionWatcher } from '@/domains/extension/main'
import { TalismanExtensionSynchronizer } from '@/domains/extension/TalismanExtensionSynchronizer'
import { EvmProvider } from '@/domains/extension/wagmi'
-import * as Portfolio from '@/libs/portfolio'
-import TalismanProvider from '@/libs/talisman'
import router from '@/routes'
const App = () => (
@@ -43,21 +42,30 @@ const App = () => (
deriveState={chainDeriveState}
queryMultiState={chainQueryMultiState}
>
-
-
-
-
-
-
-
- }>
-
-
-
-
-
-
-
+
+
+
+
+
+
+ }>
+
+
+
+
+
+
diff --git a/apps/portal/src/components/legacy/Await.tsx b/apps/portal/src/components/legacy/Await.tsx
deleted file mode 100644
index 37df39e54..000000000
--- a/apps/portal/src/components/legacy/Await.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import styled from '@emotion/styled'
-
-import Loader from '@/assets/icons/loader.svg?react'
-
-const StyledLoader = styled(({ className }: { className?: string }) => (
-
-
-
-))`
- display: block;
- padding: 2rem;
- width: 100%;
- text-align: center;
- font-size: inherit;
- > svg {
- font-size: inherit;
- }
-`
-
-/** @deprecated */
-export const Await = ({ until = true, children }: { until: boolean; children: React.ReactNode }) =>
- until ? <>{children}> :
diff --git a/apps/portal/src/components/legacy/Button.tsx b/apps/portal/src/components/legacy/Button.tsx
deleted file mode 100644
index e343b638c..000000000
--- a/apps/portal/src/components/legacy/Button.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { css } from '@emotion/react'
-import styled from '@emotion/styled'
-import { omit } from 'lodash'
-import React, { Fragment } from 'react'
-import { Link, NavLink } from 'react-router-dom'
-
-import IconLoading from '@/assets/icons/loader.svg?react'
-
-/** @deprecated */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export const Button = styled(({ loading, children, variant = '', className, ...props }: any) => {
- const wrappedChildren = loading ? (
-
-
- {loading}
-
- ) : (
- React.Children.map(children, child =>
- React.isValidElement(child) ? child : {child}
- )
- )
-
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const _props: any = omit(props, ['loading', 'boxed', 'round', 'primary', 'tight', 'loose', 'small'])
-
- return props?.to ? (
- props?.navlink ? (
-
- {wrappedChildren}
-
- ) : (
-
- {wrappedChildren}
-
- )
- ) : (
-
- )
-})`
- border: none;
- padding: 1.156rem 1.6rem;
- margin: 0;
- line-height: 1em;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- cursor: pointer;
- background: rgb(${({ theme }) => theme?.dim});
- color: rgb(${({ theme }) => theme?.mid});
- border-radius: 1rem;
- transition: all 0.15s ease-in-out;
- white-space: nowrap;
-
- &.outlined {
- color: var(--color-text);
- border: 1px solid var(--color-text);
- background: transparent;
- }
-
- .child {
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
-
- > * {
- margin: 0 0.5rem;
- font-size: inherit;
- font: inherit;
- color: inherit;
- }
-
- &:hover {
- opacity: 0.8;
- }
-
- ${({ primary, theme }) =>
- !!primary &&
- css`
- background: rgb(${theme?.primary});
- color: rgb(${theme?.background});
- border: 3.13px solid rgb(${theme.primary});
- `}
-
- ${({ small }) =>
- !!small &&
- css`
- padding: 1em 1.6em;
- `}
-
- &[disabled] {
- opacity: 0.4;
- filter: grayscale(100%);
- color: var(--color-mid);
- cursor: not-allowed;
- }
-`
diff --git a/apps/portal/src/components/legacy/Countdown.tsx b/apps/portal/src/components/legacy/Countdown.tsx
deleted file mode 100644
index 9f22474ef..000000000
--- a/apps/portal/src/components/legacy/Countdown.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import { useEffect, useMemo, useRef, useState } from 'react'
-
-/** @deprecated */
-const useInterval = (cb = () => {}, ms = 1000) => {
- const savedCallback = useRef<() => void>()
- const [id, setId] = useState(null)
-
- useEffect(() => {
- savedCallback.current = cb
- }, [cb])
-
- useEffect(() => {
- const tick = () => typeof savedCallback?.current !== 'undefined' && savedCallback?.current()
- const _id = setInterval(tick, ms)
- setId(_id)
- return () => clearInterval(_id)
- }, [ms])
-
- return id
-}
-
-const useCountdown = (seconds = 0) => {
- const [secondsRemaining, setSecondsRemaining] = useState(Math.max(0, seconds))
-
- useEffect(() => {
- setSecondsRemaining(Math.max(0, seconds))
- }, [seconds])
-
- useInterval(() => setSecondsRemaining(Math.max(0, secondsRemaining - 1)))
-
- return useMemo(() => secondsRemaining, [secondsRemaining])
-}
-
-const minute = 60
-const hour = 60 * minute
-const day = 24 * hour
-const week = 7 * day
-
-/** @deprecated */
-export const Countdown = ({
- seconds: countdownSeconds = 10,
- showSeconds = true,
-}: {
- seconds: number
- showSeconds: boolean
-}) => {
- const remaining = useCountdown(countdownSeconds)
-
- const weeks = Math.max(0, Math.floor(remaining / week))
- const weeksRemainder = remaining % week
-
- const days = Math.max(0, Math.floor(weeksRemainder / day))
- const daysRemainder = weeksRemainder % day
-
- const hours = Math.max(0, Math.floor(daysRemainder / hour))
- const hoursRemainder = daysRemainder % hour
-
- const minutes = Math.max(0, Math.floor(hoursRemainder / minute))
- const seconds = hoursRemainder % minute
-
- const segments = [
- weeks > 0 && `${weeks}w`,
- days > 0 && `${days}d`,
- `${hours}h`,
- `${minutes.toString().padStart(2, '0')}m`,
- showSeconds && seconds > 0 && `${seconds}s`,
- ].filter(Boolean)
-
- return <>{segments.join(' ')}>
-}
diff --git a/apps/portal/src/components/legacy/DesktopRequired.tsx b/apps/portal/src/components/legacy/DesktopRequired.tsx
deleted file mode 100644
index af88b54dd..000000000
--- a/apps/portal/src/components/legacy/DesktopRequired.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import styled from '@emotion/styled'
-import { useEffect } from 'react'
-import { useTranslation } from 'react-i18next'
-
-import { Button } from '@/components/legacy/Button'
-import { useModal } from '@/components/legacy/Modal'
-import { isMobileBrowser } from '@/util/helpers'
-
-/** @deprecated */
-export const DesktopRequired = () => {
- const { openModal } = useModal()
-
- useEffect(() => {
- if (!isMobileBrowser()) return
-
- openModal(, { closable: false })
- }, [openModal])
-
- return null
-}
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-const DesktopRequiredModal = styled((props: any) => {
- const { closeModal } = useModal()
- const { t } = useTranslation()
-
- return (
-
-
{t('desktopRequired.title')}
-
{t('desktopRequired.subtitle')}
-
{t('desktopRequired.text')}
-
-
- )
-})`
- text-align: center;
-
- > *:not(:last-child) {
- margin-bottom: 2rem;
- }
-
- h2 {
- color: var(--color-text);
- font-weight: 600;
- font-size: 1.8rem;
- }
- p {
- color: #999;
- font-size: 1.6rem;
- }
-`
diff --git a/apps/portal/src/components/legacy/FieldWrapper.tsx b/apps/portal/src/components/legacy/FieldWrapper.tsx
deleted file mode 100644
index 1fb3ca3d9..000000000
--- a/apps/portal/src/components/legacy/FieldWrapper.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import styled from '@emotion/styled'
-
-// May want to figure out what prefix's and onClick actual type is
-type FieldWrapperProps = {
- type: string
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- prefix?: any
- suffix?: React.ReactNode
- className?: string
- children?: React.ReactNode
- label?: string
- dim?: boolean
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- onClick?: any
-}
-
-/** @deprecated */
-export const FieldWrapper = styled(
- ({ type, prefix, suffix, label, dim, children, className, ...rest }: FieldWrapperProps) => (
-
- {label && {label}}
-
- {!!prefix && {prefix}}
- {children}
- {!!suffix && {suffix}}
-
-
- )
-)`
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- color: var(--color-text);
-
- > .children {
- border: none;
- box-shadow: 0 0 1.2rem rgba(0, 0, 0, 0.1);
- border-radius: 1rem;
- overflow: hidden;
- transition: box-shadow 0.2s ease;
- display: block;
- width: 100%;
-
- &:hover {
- box-shadow: 0 0 2rem rgba(0, 0, 0, 0.15);
- }
-
- .prefix,
- .suffix {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- opacity: 0.4;
- pointer-events: none;
- > * {
- display: block;
- width: 1.5em;
- height: 1.5em;
- }
- }
-
- .prefix {
- left: 1em;
- }
- .suffix {
- right: 0.7em;
- }
-
- input,
- select {
- font-size: 1.2em;
- font-family: inherit;
- font-weight: inherit;
- border: none;
- padding: 1.1rem 1.5rem;
- width: 100%;
- ${({ prefix }) => !!prefix && `padding-left: 5rem;`}
- ${({ suffix }) => !!suffix && `padding-right: 2rem;`}
- &:hover {
- color: var(--color-text);
- }
- transition: all 0.2s ease-in-out;
- }
-
- select {
- cursor: pointer;
- }
- }
-
- &.dim {
- > .children {
- border-radius: 0.8rem;
- box-shadow: none;
-
- input,
- select {
- background: var(--color-controlBackground);
- }
- }
- }
-
- ::placeholder {
- color: var(--color-dim);
- }
-`
-
-type FieldLabelProps = {
- className?: string
- children?: string
-}
-
-/** @deprecated */
-const FieldLabel = styled(({ children, className, ...rest }: FieldLabelProps) =>
- children ? (
-
- ) : null
-)`
- position: relative;
- font-size: 0.6em;
- text-transform: uppercase;
- font-weight: var(--font-weight-bold);
- color: rgb(${({ theme }) => theme.mid});
- white-space: pre-line;
- text-align: right;
- line-height: 1.2em;
- opacity: 0.8;
-`
diff --git a/apps/portal/src/components/legacy/Grid.tsx b/apps/portal/src/components/legacy/Grid.tsx
deleted file mode 100644
index 068b29548..000000000
--- a/apps/portal/src/components/legacy/Grid.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-
-import styled from '@emotion/styled'
-import { sortBy } from 'lodash'
-
-const defaultColumns = 4
-
-const defaultGap = '2.4rem'
-
-const defaultBreakpoints = {
- 1320: { columns: 3 },
- 1020: { columns: 2 },
- 700: { columns: 1 },
-}
-
-type GridProps = {
- children: React.ReactNode
- className?: string
- columns?: number
- gap?: any
- breakpoints?: any
-}
-
-/** @deprecated */
-export const Grid = styled(({ className, children }: GridProps) => (
- {children}
-))`
- display: grid;
- grid-gap: 2.4rem;
- width: 100%;
- grid-template-columns: repeat(${({ columns = defaultColumns }) => columns}, 1fr);
- margin: ${({ gap = defaultGap }) => gap} 0;
-
- > * {
- ${({ itemHeight }: { itemHeight?: any }) => !!itemHeight && `height: ${itemHeight as number}`}
- }
-
- ${({ breakpoints = defaultBreakpoints, columns = defaultColumns, itemHeight }) =>
- sortBy(Object.entries(breakpoints), (bp: any) => parseInt(bp))
- .reverse()
- .map(
- (key: any) =>
- `
- @media only screen and (max-width: ${key[0] as string}px) {
- grid-template-columns: repeat(${key[1]?.columns || columns}, 1fr);
- >*{
- height: ${key[1]?.itemHeight || itemHeight || 'inherit'};
- }
- };
- `
- )}
-`
diff --git a/apps/portal/src/components/legacy/Input.tsx b/apps/portal/src/components/legacy/Input.tsx
deleted file mode 100644
index 84ca95ccf..000000000
--- a/apps/portal/src/components/legacy/Input.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-
-import styled from '@emotion/styled'
-
-import { FieldWrapper } from '@/components/legacy/FieldWrapper'
-
-type InputProps = {
- className?: string
- onChange?: (e: any) => void
- type?: string
- inputMode?: string
- pattern?: string
- prefix?: any
- suffix?: React.ReactNode
- label?: string
- dim?: boolean
- value?: any
- placeholder?: string
- disabled?: boolean
-}
-
-/** @deprecated */
-export const Input = styled(({ className, onChange = _v => {}, prefix, suffix, label, dim, ...rest }: InputProps) => (
-
- onChange(e?.target?.value)} {...(rest as any)} />
-
-))``
diff --git a/apps/portal/src/components/legacy/MaterialLoader.tsx b/apps/portal/src/components/legacy/MaterialLoader.tsx
deleted file mode 100644
index 99063af75..000000000
--- a/apps/portal/src/components/legacy/MaterialLoader.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import styled from '@emotion/styled'
-
-/** @deprecated */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export const MaterialLoader = styled((props: any) => (
-
-
-
-))`
- position: relative;
- margin: 0 auto;
- width: 1em;
- &:before {
- content: '';
- display: block;
- padding-top: 100%;
- }
-
- svg {
- animation: rotate 2s linear infinite;
- height: 100%;
- transform-origin: center center;
- width: 100%;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- margin: auto;
- }
-
- circle {
- stroke-dasharray: 1, 200;
- stroke-dashoffset: 0;
- animation: dash 1.5s ease-in-out infinite;
- stroke: currentColor;
- stroke-linecap: round;
- }
-
- @keyframes rotate {
- 100% {
- transform: rotate(360deg);
- }
- }
-
- @keyframes dash {
- 0% {
- stroke-dasharray: 1, 200;
- stroke-dashoffset: 0;
- }
- 50% {
- stroke-dasharray: 89, 200;
- stroke-dashoffset: -35px;
- }
- 100% {
- stroke-dasharray: 89, 200;
- stroke-dashoffset: -124px;
- }
- }
-`
diff --git a/apps/portal/src/components/legacy/Modal.tsx b/apps/portal/src/components/legacy/Modal.tsx
deleted file mode 100644
index f15b675aa..000000000
--- a/apps/portal/src/components/legacy/Modal.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-// TODO: remove legacy modal completely
-
-import type { PropsWithChildren } from 'react'
-import { AlertDialog } from '@talismn/ui/molecules/AlertDialog'
-import { createContext, useCallback, useContext, useMemo, useState } from 'react'
-
-import useKeyDown from '@/util/useKeyDown'
-
-type OpenModalOptions = {
- closable: boolean
-}
-
-type ContextProps = {
- open: boolean
- content: JSX.Element | null
- openModal: (content: JSX.Element, options?: OpenModalOptions) => void
- closeModal: () => void
-}
-
-const Context = createContext(null)
-/** @deprecated */
-export function useModal(): ContextProps {
- const context = useContext(Context)
- if (!context) throw new Error('The modal provider is required in order to use this hook')
-
- return context
-}
-
-type ProviderProps = PropsWithChildren
-/** @deprecated */
-export function ModalProvider({ children }: PropsWithChildren): JSX.Element {
- const [content, setContent] = useState(null)
- const [closable, setClosable] = useState(true)
-
- const openModal = useCallback((content: JSX.Element, options?: OpenModalOptions) => {
- setContent(content)
- setClosable(options?.closable !== false)
- }, [])
- const closeModal = useCallback(() => setContent(null), [])
-
- const value = useMemo(
- () => ({ open: content !== null, content, openModal, closeModal }),
- [content, openModal, closeModal]
- )
-
- return (
-
-
- {children}
-
- )
-}
-
-/** @deprecated */
-const Modal = function Modal({ className, closable }: { className?: string; closable: boolean }) {
- const { open, content, closeModal } = useModal()
-
- useKeyDown(
- 'Escape',
- useCallback(() => {
- open && closable && closeModal()
- }, [open, closable, closeModal])
- )
-
- return
-}
diff --git a/apps/portal/src/components/legacy/NoResults.tsx b/apps/portal/src/components/legacy/NoResults.tsx
deleted file mode 100644
index ffa35e20c..000000000
--- a/apps/portal/src/components/legacy/NoResults.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import type { PropsWithChildren } from 'react'
-import styled from '@emotion/styled'
-import React from 'react'
-
-type NoResultsMessageProps = {
- className?: string
- subtitle: string
- text: string
-}
-
-const NoResultsMessage = styled(({ subtitle, text, className }: NoResultsMessageProps) => (
-
- {subtitle &&
{subtitle}
}
- {text &&
{text}
}
-
-))`
- display: block;
- padding: 2rem;
- text-align: center;
- width: 100%;
-`
-
-/** @deprecated */
-export type NoResultProps = PropsWithChildren<{
- require: boolean
-}> &
- NoResultsMessageProps
-
-/** @deprecated */
-export const NoResults = ({ require, children, ...props }: NoResultProps) => {
- // undefined not set? await children
- // require is explicitly set to false
- return (require === undefined && !React.Children.count(children)) || !require ? (
-
- ) : (
- <>{children}>
- )
-}
diff --git a/apps/portal/src/components/legacy/Panel.tsx b/apps/portal/src/components/legacy/Panel.tsx
deleted file mode 100644
index 3a3ed6c1f..000000000
--- a/apps/portal/src/components/legacy/Panel.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import type { MotionProps } from 'framer-motion'
-import { css } from '@emotion/react'
-import styled from '@emotion/styled'
-import { motion } from 'framer-motion'
-import { type ReactNode } from 'react'
-
-type Props = {
- title?: string
- subtitle?: string | ReactNode
- className?: string
- children?: ReactNode
- comingSoon?: boolean
-} & MotionProps
-
-/** @deprecated */
-export const Panel = styled(({ title, subtitle, children, className, ...rest }: Props) => (
-
- {title !== undefined && (
-
- {title}
- {subtitle !== undefined && {subtitle}}
-
- )}
- {children}
-
-))`
- width: 100%;
-
- > h1 {
- display: flex;
- align-items: baseline;
- margin-bottom: 0.8em;
- font-size: var(--font-size-large);
- font-weight: bold;
- color: var(--color-text);
-
- > span {
- font-size: var(--font-size-normal);
- margin-left: 0.85em;
- color: var(--color-primary);
- font-weight: normal;
- }
- }
-
- > .inner {
- display: block;
- border-radius: 1.6rem;
- user-select: none;
- background: #1b1b1b;
- color: rgb(${({ theme }) => theme.foreground});
-
- // add a bottom border to every row except the last one
- > .panel-section:not(:last-child) {
- border-bottom: 1px solid rgba(${({ theme }) => theme.foreground}, 0.05);
- }
-
- .panel-section + .panel-section {
- border-top: 1px solid rgba(${({ theme }) => theme.foreground}, 0.05);
- }
- }
-`
-
-/** @deprecated */
-export const PanelSection = styled(({ title, children, className, comingSoon, ...rest }: Props) => (
-
- {!!title && {title}
}
- {children}
-
-))`
- display: block;
- padding: 1.55rem 2rem;
-
- h2 {
- font-size: var(--font-size-xsmall);
- font-weight: bold;
- color: var(--color-mid);
- margin-bottom: 1.4em;
- }
-
- ${props =>
- props.comingSoon &&
- css`
- padding: 6rem 2rem;
- color: var(--color-mid);
- text-align: center;
- `}
-`
diff --git a/apps/portal/src/components/legacy/Pendor.tsx b/apps/portal/src/components/legacy/Pendor.tsx
deleted file mode 100644
index bcbd73bf1..000000000
--- a/apps/portal/src/components/legacy/Pendor.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { type PropsWithChildren, type ReactElement } from 'react'
-
-import Loader from '@/assets/icons/loader.svg?react'
-
-export type PendorProps = {
- prefix?: React.ReactNode
- suffix?: React.ReactNode
- require?: boolean
- loader?: ReactElement
-}
-
-/** @deprecated */
-export const Pendor = ({
- prefix = '',
- suffix = '',
- require,
- loader,
- children,
-}: PropsWithChildren): ReactElement => {
- // undefined not set? await children
- // require is explicitly set to false
- if ((require === undefined && !children) || require === false) return loader ??
-
- return (
- <>
- {prefix}
- {children}
- {suffix}
- >
- )
-}
diff --git a/apps/portal/src/components/legacy/Pill.tsx b/apps/portal/src/components/legacy/Pill.tsx
deleted file mode 100644
index b555c6f7d..000000000
--- a/apps/portal/src/components/legacy/Pill.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import styled from '@emotion/styled'
-
-/** @deprecated */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export const Pill = styled(({ children, className, small, large, primary, secondary, active, ...rest }: any) => (
-
- {children}
-
-))`
- transition: all 0.2s;
- line-height: 1em;
- padding: 0.6em 1.2em;
- display: inline-flex;
- align-items: center;
- border-radius: 4rem;
- user-select: none;
- background: rgb(${({ theme }) => theme?.background});
- color: rgb(${({ theme }) => theme?.foreground});
- box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.1);
- font-size: 1em;
-
- * {
- line-height: 1em;
- }
-
- ${({ onClick }) =>
- !!onClick &&
- `
- cursor: pointer;
- `}
-
- ${({ small }) =>
- small &&
- `
- font-size: 0.85em;
- padding: 0.6em 0.9em;
- `}
-
- ${({ large }) =>
- large &&
- `
- font-size: 1.1em;
- padding: 0.6em 1.4em;
- `}
-
- ${({ primary, onClick }) =>
- !!primary &&
- `
- background: var(--color-controlBackground);
- color: var(--color-foreground);
- box-shadow: none;
- ${
- !!onClick &&
- `
- &:hover{
- background: var(--color-activeBackground);
- color: var(--color-text);
- }
- `
- }
- `}
-
- ${({ secondary, onClick }) =>
- !!secondary &&
- `
- background: var(--color-controlBackground);
- color: var(--color-foreground);
- box-shadow: none;
- ${
- !!onClick &&
- `
- &:hover{
- background: var(--color-background);
- color: var(--color-text);
- }
- `
- }
- `}
-
- ${({ active, secondary, theme }) =>
- !!active &&
- `
- background: ${secondary ? `var(--color-activeBackground)` : `rgb(${theme?.primary as string})`};
- color: ${secondary ? `var(--color-text)` : `rgb(${theme?.background as string})`};
- box-shadow: none;
- `}
-`
diff --git a/apps/portal/src/components/legacy/Poster.tsx b/apps/portal/src/components/legacy/Poster.tsx
deleted file mode 100644
index b89a2a1fb..000000000
--- a/apps/portal/src/components/legacy/Poster.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import styled from '@emotion/styled'
-import { type PropsWithChildren } from 'react'
-
-import useImageWithFallback from '@/util/useImageWithFallback'
-
-/** @deprecated */
-export const Poster = styled(
- ({
- title,
- subtitle,
- backgroundImage,
- fallbackBackgroundImage,
- children,
- className,
- }: PropsWithChildren<{
- title?: string
- subtitle?: string
- backgroundImage?: string
- fallbackBackgroundImage?: string
- className?: string
- }>) => {
- const imageSrc = useImageWithFallback(backgroundImage, fallbackBackgroundImage)
-
- return (
-
-
- {title}
-
- {children}
-
-
- )
- }
-)`
- display: block;
- width: 100%;
- height: 24vw;
- min-height: 34rem;
- max-height: 60rem;
- background-color: rgba(0, 0, 0, 0.1);
- background-size: cover;
- background-repeat: no-repeat;
- background-position: 50% 50%;
- position: relative;
- padding: 3vw;
-
- .content {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- text-align: center;
- width: 100%;
-
- h1 {
- margin: 0;
- }
-
- h2 {
- margin: 1.6vw 0 2.9vw;
- line-height: 1.3em;
- }
-
- > .children {
- margin: 0;
- }
- }
-`
diff --git a/apps/portal/src/components/legacy/ProgressBar.tsx b/apps/portal/src/components/legacy/ProgressBar.tsx
deleted file mode 100644
index f658a57b0..000000000
--- a/apps/portal/src/components/legacy/ProgressBar.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import styled from '@emotion/styled'
-
-/** @deprecated */
-export const ProgressBar = styled(({ percent, className }: { className?: string; percent?: number }) => (
-
-
-
-))`
- display: block;
- height: 1em;
- border-radius: 0.5em;
- position: relative;
- overflow: hidden;
- background: rgb(${({ theme }) => theme.foreground}, 0.1);
- color: rgb(${({ theme }) => theme.foreground});
-
- > span {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- height: 1em;
- background: rgb(${({ theme }) => theme.primary});
- transition: all 0.3s ease-out;
- }
-`
diff --git a/apps/portal/src/components/legacy/RadioGroup.tsx b/apps/portal/src/components/legacy/RadioGroup.tsx
deleted file mode 100644
index 9a4afb750..000000000
--- a/apps/portal/src/components/legacy/RadioGroup.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-
-import styled from '@emotion/styled'
-
-import { FieldWrapper } from '@/components/legacy/FieldWrapper'
-import { Pill } from '@/components/legacy/Pill'
-
-type RadioGroupProps = {
- value: string
- options?: any
- className?: string
- onChange?: (value: string) => void
- small?: boolean
- primary?: boolean
- secondary?: boolean
-}
-
-/** @deprecated */
-export const RadioGroup = styled(
- ({ value, options = {}, onChange = () => {}, small, primary, secondary, className }: RadioGroupProps) => (
-
- {options.map((option: Record) => (
- onChange(option?.['key'])}
- active={option?.['key'] === value}
- small={small}
- primary={primary}
- secondary={secondary}
- >
- {option?.['value']}
-
- ))}
-
- )
-)`
- .children {
- display: flex;
- gap: 0.25rem;
- box-shadow: none;
- overflow: visible;
- &:hover {
- box-shadow: none;
- }
-
- background: var(--color-controlBackground);
- padding: 0.25rem;
- border-radius: 1.5rem;
- }
-`
diff --git a/apps/portal/src/components/legacy/Stat.tsx b/apps/portal/src/components/legacy/Stat.tsx
deleted file mode 100644
index 9588a6ed0..000000000
--- a/apps/portal/src/components/legacy/Stat.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import styled from '@emotion/styled'
-import { type PropsWithChildren, type ReactNode } from 'react'
-
-/** @deprecated */
-export const Stat = styled(
- ({ title, children, className, ...rest }: PropsWithChildren<{ title: ReactNode; className?: string }>) => (
-
- {!!title && {title}}
- {children}
-
- )
-)`
- display: flex;
- justify-content: space-between;
- align-items: center;
- list-style: inherit;
-`
diff --git a/apps/portal/src/components/legacy/TalismanHandLike.tsx b/apps/portal/src/components/legacy/TalismanHandLike.tsx
deleted file mode 100644
index 20b3b85c5..000000000
--- a/apps/portal/src/components/legacy/TalismanHandLike.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { type ImgHTMLAttributes } from 'react'
-
-import TalismanHandLikeImg from '@/assets/thumbs_up_red.gif'
-
-/** @deprecated */
-export const TalismanHandLike = (props: ImgHTMLAttributes) => {
- return
-}
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanBonus.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanBonus.tsx
deleted file mode 100644
index 1a2894ed5..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanBonus.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import type { ReactNode } from 'react'
-import { useMemo } from 'react'
-
-import { useCrowdloanById } from '@/libs/talisman'
-import { Maybe } from '@/util/monads'
-
-export type BonusProps = {
- id: string
- short?: boolean
- full?: boolean
- info?: boolean
- prefix?: ReactNode
-}
-
-/** @deprecated */
-export const CrowdloanBonus = ({ id, short, full, info, prefix }: BonusProps) => {
- const bonus = useCrowdloanById(id).crowdloan?.details?.bonus
- const type = short ? 'short' : full ? 'full' : info ? 'info' : undefined
-
- const content = useMemo(() => {
- if (short) return bonus?.short
- if (full) return Maybe.ofFalsy(bonus?.full).mapOrUndefined(x => {x})
- if (info) return bonus?.info
- return undefined
- }, [bonus, full, info, short])
-
- if (!content || type === undefined) return null
-
- return (
- *': {
- display: 'inline-block',
- },
- '&.type-full': {
- '> *': {
- lineHeight: '1em',
- verticalAlign: 'center',
- display: 'inline-block',
- },
- '.popup': {
- marginLeft: '0.4rem',
- '.icon-help': {
- color: 'var(--color-primary)',
- },
- },
- },
- }}
- >
- {prefix !== undefined && {prefix}}
- {content}
-
- )
-}
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanContribute.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanContribute.tsx
deleted file mode 100644
index 1f518f58a..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanContribute.tsx
+++ /dev/null
@@ -1,778 +0,0 @@
-import type { MouseEventHandler } from 'react'
-import { useTheme } from '@emotion/react'
-import styled from '@emotion/styled'
-import { CircularProgressIndicator } from '@talismn/ui/atoms/CircularProgressIndicator'
-import { Text } from '@talismn/ui/atoms/Text'
-import { useCallback, useEffect, useMemo, useState } from 'react'
-import { useTranslation } from 'react-i18next'
-import { useRecoilValue } from 'recoil'
-
-import XCircle from '@/assets/icons/x-circle.svg?react'
-import { Button } from '@/components/legacy/Button'
-import { DesktopRequired } from '@/components/legacy/DesktopRequired'
-import { Input } from '@/components/legacy/Input'
-import { MaterialLoader } from '@/components/legacy/MaterialLoader'
-import { useModal } from '@/components/legacy/Modal'
-import { TalismanHandLike } from '@/components/legacy/TalismanHandLike'
-import { TalismanHandLoader } from '@/components/legacy/TalismanHandLoader'
-import { ParachainAsset } from '@/components/legacy/widgets/ParachainAsset'
-import { useAccountSelector } from '@/components/widgets/AccountSelector'
-import { writeableSubstrateAccountsState } from '@/domains/accounts/recoils'
-import { ContributeEvent, useCrowdloanContribute } from '@/libs/crowdloans'
-import { Acala, Moonbeam, overrideByIds, Polkadex } from '@/libs/crowdloans/crowdloanOverrides'
-import { useCrowdloanById } from '@/libs/talisman'
-import { isMobileBrowser } from '@/util/helpers'
-import { Maybe } from '@/util/monads'
-
-export type ContributeProps = {
- className?: string
- id?: string
-}
-
-/** @deprecated */
-export function CrowdloanContribute({ className, id }: ContributeProps) {
- const { closeModal } = useModal()
-
- const [contributeState, dispatch] = useCrowdloanContribute()
-
- const { crowdloan } = useCrowdloanById(id)
- useEffect(() => {
- if (!id || !crowdloan) return
-
- const relayChainId = crowdloan.relayChainId
- const parachainId = Number(crowdloan.parachain.paraId.split('-').slice(-1)[0])
-
- dispatch(ContributeEvent.initialize({ crowdloanId: id, relayChainId, parachainId }))
- }, [id, crowdloan, dispatch])
-
- if (isMobileBrowser()) return
-
- return (
- <>
- {contributeState.match({
- Uninitialized: () => null,
- Initializing: () => ,
-
- NoRpcsForRelayChain: () => 'Sorry, making contributions to this crowdloan via Talisman is not yet supported.',
- NoChaindataForRelayChain: () =>
- 'Sorry, making contributions to this crowdloan via Talisman is not yet supported.',
- IpBanned: () => 'Sorry, this crowdloan is not accepting contributions from IP addresses within your region.',
-
- Ready: props => (
-
- ),
- RegisteringUser: props => (
-
- ),
- ContributionSubmitting: props => (
-
- ),
- ContributionSuccess: props => (
-
- ),
- ContributionFailed: props => (
-
- ),
- })}
- >
- )
-}
-
-const ContributeTo = styled(
- ({
- className,
- closeModal,
- dispatch,
-
- relayChainId,
- relayNativeToken,
- parachainId,
- parachainName,
-
- contributionAmount,
- accountBalance,
- email,
- memoAddress,
-
- validationError,
- submissionRequested,
- }: // eslint-disable-next-line @typescript-eslint/no-explicit-any
- any) => {
- const theme = useTheme()
- const { t } = useTranslation()
- const { t: tError } = useTranslation('errors')
-
- const [chainHasTerms, termsAgreed, onTermsCheckboxClick] = useTerms(relayChainId, parachainId)
-
- const [[account], accountSelector] = useAccountSelector(useRecoilValue(writeableSubstrateAccountsState), 0)
-
- useEffect(() => {
- dispatch(ContributeEvent.setAccount(account?.address))
- }, [dispatch, account])
-
- return (
-
- )
- }
-)`
- max-width: 648px;
-
- > header {
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- > header > h2 {
- text-align: center;
- font-size: 2.4rem;
- font-weight: 600;
- margin-bottom: 2.4rem;
- }
- > header > .logo {
- font-size: 6.4rem;
- margin-bottom: 1.6rem;
- user-select: none;
- }
- > header > h3 {
- font-size: 1.8rem;
- font-weight: 600;
- margin-bottom: 4.8rem;
- }
-
- > main > .row {
- display: flex;
- flex-direction: column;
- margin-bottom: 3.4rem;
- &:last-child {
- margin-bottom: 4rem;
- }
- }
- > main > .row.split {
- flex-direction: row;
- align-items: flex-start;
- }
- > main > .row > .amount-input {
- width: 100%;
- flex: 2 0 0%;
- margin-right: 1.6rem;
-
- input {
- font-size: 3.2rem;
- font-weight: 600;
- padding: 0.4rem 7rem 0.4rem 2.4rem;
-
- .suffix {
- right: 2.4rem;
- }
- }
-
- > .info-row {
- width: 100%;
- margin-top: 1rem;
- display: flex;
- justify-content: space-between;
- color: rgb(${({ theme }) => theme?.mid});
- font-size: var(--font-size-small);
-
- .error {
- color: var(--color-status-error);
- text-align: right;
- margin-left: 1rem;
- max-width: 75%;
- }
- }
-
- > .info-row.usd-and-error {
- min-height: 2.2rem;
- }
- }
- > main > .row > .switcher-column {
- > .account-switcher-pill {
- flex: 0 0 0%;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 5.9rem;
- padding: 0 0.5rem;
- border-radius: 4rem;
- background: rgb(${({ theme }) => theme?.background});
- color: rgb(${({ theme }) => theme?.foreground});
- box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.1);
- }
- > .tx-fee {
- display: flex;
- align-items: center;
- justify-content: end;
- white-space: pre;
- width: 100%;
- margin-top: 1rem;
- text-align: right;
- color: rgb(${({ theme }) => theme?.mid});
- font-size: var(--font-size-small);
- min-height: 2.2rem;
- }
- }
- > main > .row > .memo-address-input,
- > main > .row > .email-input,
- > main > .row > .verifier-input {
- .field {
- margin-bottom: 1.6rem;
-
- input {
- font-size: 1.8rem;
- &::placeholder {
- color: #999;
- }
- }
- }
- .info {
- color: #999;
- font-size: 1.4rem;
- line-height: 1.8rem;
-
- a {
- color: var(--color-primary);
- }
- }
- }
-
- > footer {
- display: flex;
- > * {
- flex: 1 0 0%;
- &:not(:last-child) {
- margin-right: 1.6rem;
- }
- }
- }
-`
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export type ProgressProps = { className?: string; explorerUrl?: string; closeModal: () => unknown; error?: any }
-
-const InProgress = styled(({ className, explorerUrl, closeModal }: ProgressProps) => {
- const { t } = useTranslation('crowdloan')
- return (
-
-
- {t('inProgress.header')}
-
-
-
- {t('inProgress.description')}
- {explorerUrl && (
-
- {t('inProgress.primaryCta')}
-
- )}
-
-
-
- )
-})`
- > header {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 4rem;
- }
- > header > h2 {
- text-align: center;
- font-size: 2.4rem;
- font-weight: 600;
- }
- > header > .logo {
- font-size: 6.4rem;
- margin-bottom: 8.2rem;
- color: var(--color-primary);
- user-select: none;
- }
-
- > main {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 4rem;
-
- div:first-child {
- margin-bottom: 4rem;
- }
- a {
- display: block;
- color: var(--color-background);
- background: var(--color-primary);
- border-radius: 5.6rem;
- padding: 0.6rem 1.2rem;
- cursor: pointer;
- }
- }
-
- > footer {
- display: flex;
- justify-content: center;
-
- button {
- min-width: 27.8rem;
- }
- }
-`
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-const RegisteringUser = styled(({ className, dispatch, submissionRequested }: any) => {
- const { t } = useTranslation('crowdloan')
-
- const terms =
- 'https://glib-calendula-bf6.notion.site/Moonbeam-Crowdloan-Terms-and-Conditions-da2d8fe389214ae9a382a755110a6f45'
-
- return (
-
-
- {t('registeringUser.header')}
-
-
- {submissionRequested ? (
-
- ) : (
- <>
- {t('registeringUser.description')}
-
- {t('registeringUser.termsNote')}
-
- {t('registeringUser.feeNote')}
- >
- )}
-
-
-
- )
-})`
- > header {
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- > header > h2 {
- text-align: center;
- font-size: 2.4rem;
- font-weight: 600;
- margin-bottom: 8.2rem;
- }
- > header > .logo {
- font-size: 6.4rem;
- margin-bottom: 8.2rem;
- color: var(--color-primary);
- user-select: none;
- }
-
- > main {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 2rem;
-
- > * {
- margin-bottom: 2rem;
- }
-
- > a {
- color: var(--color-primary);
- }
-
- div:nth-child(3) {
- font-size: 1.5rem;
- color: var(--color-mid);
- font-style: italic;
- }
-
- > .loading {
- margin-top: 0;
- margin-bottom: 6.2rem;
- }
-
- > button {
- min-height: 7rem;
- }
- }
-
- > footer {
- display: flex;
- justify-content: center;
-
- button {
- min-width: 27.8rem;
- }
- }
-`
-
-const Success = styled(({ className, closeModal, explorerUrl }: ProgressProps) => {
- const { t } = useTranslation('crowdloan')
- return (
-
-
- {t('success.header')}
-
-
-
- {t('success.description')}
- {explorerUrl && (
-
- {t('success.primaryCta')}
-
- )}
-
-
-
- )
-})`
- > header {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 4rem;
- }
- > header > h2 {
- text-align: center;
- font-size: 2.4rem;
- font-weight: 600;
- }
- > header > .logo {
- font-size: 6.4rem;
- margin-bottom: 8.2rem;
- color: var(--color-primary);
- user-select: none;
- }
-
- > main {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 4rem;
-
- div:first-child {
- margin-bottom: 4rem;
- }
- a {
- display: block;
- color: var(--color-background);
- background: var(--color-primary);
- border-radius: 5.6rem;
- padding: 0.6rem 1.2rem;
- cursor: pointer;
- }
- }
-
- > footer {
- display: flex;
- justify-content: center;
-
- button {
- min-width: 27.8rem;
- }
- }
-`
-
-const Failed = styled(({ className, explorerUrl, error, closeModal }: ProgressProps) => {
- const { t } = useTranslation('crowdloan')
- return (
-
-
- {t('failed.header')}
-
-
-
-
-
{t('failed.description')}
- {error &&
{error}
}
-
- {explorerUrl && (
-
- {t('failed.primaryCta')}
-
- )}
-
-
-
- )
-})`
- > header {
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- > header > h2 {
- text-align: center;
- font-size: 2.4rem;
- font-weight: 600;
- margin-bottom: 8.2rem;
- }
- > header > .logo {
- font-size: 6.4rem;
- margin-bottom: 8.2rem;
- color: var(--color-primary);
- user-select: none;
- }
-
- > main {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-bottom: 4rem;
-
- > div:first-child {
- margin-bottom: 4rem;
- text-align: center;
- }
- .error {
- color: var(--color-status-error);
- }
- a {
- display: block;
- color: #f46545;
- background: #fbe2dc;
- border-radius: 5.6rem;
- padding: 0.6rem 1.2rem;
- cursor: pointer;
- }
- }
-
- > footer {
- display: flex;
- justify-content: center;
-
- button {
- min-width: 27.8rem;
- }
- }
-`
-
-const Loading = styled(MaterialLoader)`
- font-size: 6.4rem;
- margin: 4rem auto;
- color: var(--color-primary);
- user-select: none;
-`
-
-function useTerms(relayId: number, paraId: number): [boolean, boolean, MouseEventHandler] {
- const chainHasTerms = useMemo(() => overrideByIds(relayId, paraId)?.terms !== undefined, [paraId, relayId])
-
- const [termsAgreed, setTermsAgreed] = useState(!chainHasTerms)
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const onTermsCheckboxClick = useCallback((event: any) => setTermsAgreed(event.target.checked), [])
-
- return [chainHasTerms, termsAgreed, onTermsCheckboxClick]
-}
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanCountdown.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanCountdown.tsx
deleted file mode 100644
index 5a383e513..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanCountdown.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import type { ReactNode } from 'react'
-import styled from '@emotion/styled'
-import { useEffect, useState } from 'react'
-
-import { Countdown as Cd } from '@/components/legacy/Countdown'
-import { Pendor } from '@/components/legacy/Pendor'
-import { useChainmetaValue, useCrowdloanById } from '@/libs/talisman'
-
-type OngoingProps = {
- end?: number
- showSeconds?: boolean
- className?: string
- relayChainId?: number
-}
-
-const Ongoing = ({ end, showSeconds, relayChainId, className = '' }: OngoingProps) => {
- const [secondsRemaining, setSecondsRemaining] = useState()
- const blockNumber = useChainmetaValue(relayChainId!, 'blockNumber')
- const blockPeriod = useChainmetaValue(relayChainId!, 'blockPeriod')
-
- useEffect(() => {
- if (!end || !blockNumber || !blockPeriod) return
- setSecondsRemaining((end - blockNumber) * blockPeriod)
- }, [end, blockNumber, blockPeriod])
-
- return (
-
-
-
-
-
- )
-}
-
-const Generic = styled(({ text, className }: { className?: string; text: ReactNode }) => (
- {text}
-))`
- display: flex;
- align-items: center;
-`
-
-type CountdownProps = {
- id?: string
- end?: number
- showSeconds?: boolean
- className?: string
-}
-
-/** @deprecated */
-export const CrowdloanCountdown = ({ id, showSeconds, className, ...rest }: CountdownProps) => {
- const { crowdloan } = useCrowdloanById(id)
-
- // Pendor
- if (!crowdloan) return
-
- const { uiStatus, end } = crowdloan
-
- if (['active', 'capped'].includes(uiStatus)) {
- return
- }
- if (uiStatus === 'winner') return
- if (uiStatus === 'ended') return
-
- // Pendor
- return
-}
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanIndex.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanIndex.tsx
deleted file mode 100644
index f6f36fc21..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanIndex.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
-
-import styled from '@emotion/styled'
-import { SearchBar } from '@talismn/ui/molecules/SearchBar'
-import { useTranslation } from 'react-i18next'
-
-import { Await } from '@/components/legacy/Await'
-import { Grid } from '@/components/legacy/Grid'
-import { NoResults } from '@/components/legacy/NoResults'
-import { RadioGroup } from '@/components/legacy/RadioGroup'
-import { useCrowdloanContributions } from '@/libs/crowdloans'
-import { device } from '@/util/breakpoints'
-
-import { CrowdloanRootNav } from './CrowdloanRootNav'
-import { CrowdloanTeaser } from './CrowdloanTeaser'
-import { useCrowdloanFilter } from './useCrowdloanFilter'
-
-const FilterBar = styled(
- ({
- search = '',
- order = '',
- status = null,
- network = null,
- setSearch = () => {},
- setOrder = () => {},
- setStatus = () => {},
- setNetwork = () => {},
- orderOptions = {},
- statusOptions = {},
- networkOptions = {},
- hasFilter = false,
- reset,
- count,
- className,
- ...rest
- }: any) => {
- const { t } = useTranslation()
- return (
-
-
{
- setSearch(search)
- }}
- />
-
- {
- setStatus(status)
- }}
- options={statusOptions}
- small
- secondary
- />
- {
- setNetwork(network)
- }}
- options={networkOptions}
- small
- primary
- />
-
-
- )
- }
-)`
- margin: 2.4rem 0;
- display: flex;
- align-items: center;
- gap: 2rem;
- flex-wrap: wrap;
-
- .searchbar {
- display: inline-block;
- width: 100%;
- @media ${device.lg} {
- width: auto;
- }
- }
-
- .filters {
- display: flex;
- flex-wrap: wrap;
- gap: 1rem;
- justify-content: space-between;
- width: 100%;
- }
-`
-
-/** @deprecated */
-export const CrowdloanIndex = styled(({ withFilter, className }: { withFilter: boolean; className?: string }) => {
- const { t } = useTranslation()
- const { crowdloans, count, loading, filterProps } = useCrowdloanFilter()
- const { gqlContributions } = useCrowdloanContributions()
-
- return (
-
-
-
- {/* TODO: Remove for now as no Learn more link yet. */}
- {/*
*/}
- {withFilter &&
}
-
- 0} subtitle={t('noCrowdloans.text')} text={t('noCrowdloans.subtext')}>
-
- {crowdloans.map(({ id }) => (
- x.id === id) !== undefined} />
- ))}
-
-
-
-
- )
-})`
- padding: 2.4rem;
-
- .await {
- font-size: var(--font-size-xxlarge);
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanRaised.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanRaised.tsx
deleted file mode 100644
index b09887895..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanRaised.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import styled from '@emotion/styled'
-import { CheckCircle } from '@talismn/web-icons'
-import { useTranslation } from 'react-i18next'
-
-import { Pendor } from '@/components/legacy/Pendor'
-import { ProgressBar } from '@/components/legacy/ProgressBar'
-import { Stat } from '@/components/legacy/Stat'
-import { useCrowdloanById } from '@/libs/talisman'
-import { shortNumber } from '@/util/helpers'
-
-/** @deprecated */
-export const CrowdloanRaised = styled(
- ({
- id,
- title,
- contributed,
- className,
- }: {
- id: string
- title?: string
- contributed?: boolean
- className?: string
- }) => {
- const { crowdloan: { percentRaised, raised, cap, uiStatus } = {} } = useCrowdloanById(id)
- const { t } = useTranslation()
-
- const suffix = (id || '').startsWith('0-') ? ' DOT' : ' KSM'
-
- return (
-
-
- {uiStatus === 'capped' ? `${t('Goal reached')} ✓` : title}
-
- {contributed && (
- <>
- {t('Contributed')}
- >
- )}
-
-
-
-
-
-
- {shortNumber(raised ?? 0)} / {shortNumber(cap ?? 0)}
-
- }
- >
-
- {percentRaised?.toFixed(2)}
-
-
-
- )
- }
-)`
- .top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: var(--font-size-small);
- margin-bottom: 0.5em;
-
- * {
- font-size: var(--font-size-small);
- margin: 0;
-
- &:first-child {
- opacity: 0.4;
- }
-
- &:last-child {
- display: flex;
- align-items: center;
- > svg {
- margin-right: 0.4em;
- font-size: 1.2em;
- color: var(--color-primary);
- }
- }
- }
- }
-
- > .stat {
- color: var(--color-text);
- margin-top: 0.7rem;
- }
-
- &[data-status='capped'] h3 {
- color: var(--color-status-success);
- opacity: 0.9;
- }
- &[data-status='capped'] > .progress-bar {
- opacity: 0.6;
- }
-
- &[data-status='winner'] {
- opacity: 0.6;
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanRewards.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanRewards.tsx
deleted file mode 100644
index 899af6fe3..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanRewards.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import styled from '@emotion/styled'
-
-import { Stat } from '@/components/legacy/Stat'
-import { useCrowdloanById } from '@/libs/talisman'
-
-/** @deprecated */
-export const CrowdloanRewards = styled(({ id, className }: { id?: string; className?: string }) => {
- const { crowdloan } = useCrowdloanById(id)
- const details = crowdloan?.details
-
- return (
-
- {details?.rewards?.tokens && (
-
- {details?.rewards?.tokens}
-
- )}
- {details?.customRewards?.map(({ title, value }, index) => (
-
- {value}
-
- ))}
- {details?.rewards?.info && (
- <>
-
-
- >
- )}
-
- )
-})`
- padding: 2.2rem 2.4rem;
-
- > .stat & + .stat {
- margin-top: 0.7rem;
- }
-
- > hr {
- margin: 1em 0;
- }
-
- > p {
- font-size: 0.8em;
- opacity: 0.8;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanRootNav.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanRootNav.tsx
deleted file mode 100644
index c59c06640..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanRootNav.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { css, useTheme } from '@emotion/react'
-import { NavLink } from 'react-router-dom'
-
-/** @deprecated */
-export const CrowdloanRootNav = () => {
- const theme = useTheme()
-
- return (
- a {
- display: inline-block;
- padding-bottom: 0.4em;
- border-bottom: 1px solid transparent;
- margin-bottom: -1px;
- }
-
- & > a.active {
- color: ${theme.color.primary};
- border-color: ${theme.color.primary};
- }
- `}
- >
-
- Participated
-
-
- Crowdloans
-
-
- )
-}
diff --git a/apps/portal/src/components/legacy/widgets/CrowdloanTeaser.tsx b/apps/portal/src/components/legacy/widgets/CrowdloanTeaser.tsx
deleted file mode 100644
index ff1c3cb0a..000000000
--- a/apps/portal/src/components/legacy/widgets/CrowdloanTeaser.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import styled from '@emotion/styled'
-import { useTranslation } from 'react-i18next'
-import { Link } from 'react-router-dom'
-
-import { Pill } from '@/components/legacy/Pill'
-import { useCrowdloanById, useParachainDetailsById } from '@/libs/talisman'
-
-import { CrowdloanBonus } from './CrowdloanBonus'
-import { CrowdloanCountdown } from './CrowdloanCountdown'
-import { CrowdloanRaised } from './CrowdloanRaised'
-import { ParachainAsset } from './ParachainAsset'
-
-/** @deprecated */
-export const CrowdloanTeaser = styled(
- ({ id, contributed, className }: { id: string; contributed?: boolean; className?: string }) => {
- const { t } = useTranslation()
- const { crowdloan } = useCrowdloanById(id)
- const parachainId = crowdloan?.parachain?.paraId
- const { parachainDetails } = useParachainDetailsById(parachainId)
-
- return (
-
-
-
-
-
{parachainDetails?.name}
-
-
-
-
-
-
-
- )
- }
-)`
- display: block;
- background: var(--color-controlBackground);
- overflow: hidden;
- border-radius: 2.4rem;
- position: relative;
-
- > .crowdloan-card {
- width: 100%;
- height: 0;
- padding-top: 58.4%;
- }
-
- > .content {
- position: relative;
- padding: 0 1.6rem 1rem 1.6rem;
-
- > .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: -3rem;
-
- > .crowdloan-logo {
- width: 6.4rem;
- height: 6.4rem;
- padding-top: 0;
- box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
- }
-
- .crowdloan-bonus {
- display: flex;
- align-items: center;
- border-radius: 2em;
- padding: 0.3em 0.8em;
- font-size: 1.4rem;
- background: var(--color-dark);
-
- .crowdloan-logo {
- font-size: 1.4rem;
- margin-right: 0.5em;
- }
- }
- }
-
- h1 {
- margin: 0;
- font-size: var(--font-size-large);
- font-weight: 600;
- margin-top: 1.2rem;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
-
- > .countdown {
- position: absolute;
- top: 1.6rem;
- right: 1.6rem;
- background: var(--color-activeBackground);
- color: var(--color-mid);
- }
-
- .crowdloan-raised {
- font-size: 0.9em;
- margin-top: calc(1.5rem + 1.5vw);
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/ExploreCard.tsx b/apps/portal/src/components/legacy/widgets/ExploreCard.tsx
deleted file mode 100644
index e1e525e59..000000000
--- a/apps/portal/src/components/legacy/widgets/ExploreCard.tsx
+++ /dev/null
@@ -1,181 +0,0 @@
-import styled from '@emotion/styled'
-import { usePostHog } from 'posthog-js/react'
-import { useCallback } from 'react'
-
-import { device } from '@/util/breakpoints'
-
-import { type Dapp } from './useFetchDapps'
-
-type CardProps = {
- className?: string
- dapp: Dapp
- setSelectedTag: (tag: string) => unknown
-}
-
-/** @deprecated */
-export const ExploreCard = styled(({ className, dapp, setSelectedTag }: CardProps) => {
- const posthog = usePostHog()
-
- const toExternalDapp = useCallback(
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (dapp: any) => {
- const categories = dapp.tags.reduce(
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (acc: any, tag: string) => ({
- ...acc,
- [`category_${tag.replace(/[^\w]/, '')}'`]: true,
- }),
- {}
- )
-
- posthog?.capture('Goto Dapp', { dappName: dapp.name, dappUrl: dapp.url, ...categories })
- window.open(dapp.url, '_blank', 'noopener,noreferrer')
- },
- [posthog]
- )
-
- return (
- toExternalDapp(dapp)}>
-
-
-
-
-
-
- {dapp.name}
- {dapp.description}
-
-
- {!!dapp.tags &&
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- dapp.tags.map((tag: any) => (
- {
- event.stopPropagation()
- setSelectedTag(tag)
- }}
- >
- {tag}
-
- ))}
-
-
-
- )
-})`
- cursor: pointer;
- background: #1e1e1e;
- border-radius: 1rem;
- border: 1px solid transparent;
- overflow: hidden;
- grid-column: span 3;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- transition: 0.2s;
- .card__header {
- min-height: 175px;
- max-height: 175px;
- overflow: hidden;
- position: relative;
- }
- .logo {
- position: absolute;
- width: 100%;
- height: 100%;
- object-fit: contain;
- padding: 1.5em;
- }
- .logoBG {
- position: absolute;
- top: 0;
- left: 0;
- filter: blur(150px) saturate(3);
- height: 100%;
- width: 100%;
- }
- .card-body {
- flex-grow: 2;
- justify-content: space-between;
-
- display: flex;
- flex-direction: column;
-
- padding: 2rem;
- h3 {
- font-size: 2rem;
- }
- p {
- font-size: 1.5rem;
- color: var(--color-mid);
- }
- a {
- background: #ffbd00;
- border-radius: 0.5rem;
- padding: 0.5rem 1rem;
- color: #1e1e1e;
- font-weight: bold;
- text-decoration: none;
- }
- .tag {
- font-size: 1rem;
- margin: 0.5rem 0.5rem 0 0;
- display: inline-block;
- padding: 0.5rem 1rem;
- background: var(--color-activeBackground);
- border-radius: 1rem;
- color: var(--color-mid);
- transition: 0.2s;
- }
-
- display: flex;
- flex-direction: column;
-
- padding: 2rem;
- h3 {
- font-size: 2rem;
- }
- p {
- font-size: 1.5rem;
- color: var(--color-mid);
- }
- a {
- background: #ffbd00;
- border-radius: 0.5rem;
- padding: 0.5rem 1rem;
- color: #1e1e1e;
- font-weight: bold;
- text-decoration: none;
- }
- .tag {
- font-size: 1rem;
- margin: 0.5rem 0.5rem 0 0;
- display: inline-block;
- padding: 0.5rem 1rem;
- background: var(--color-activeBackground);
- border-radius: 1rem;
- color: var(--color-mid);
- transition: 0.2s;
- }
-
- .tag:hover {
- background: var(--color-dim);
- transition: 0.2s;
- }
- }
- height: 450px;
-
- :nth-child(-n + 3) {
- grid-column: span 3;
- @media ${device.lg} {
- grid-column: span 4;
- }
- }
-
- :hover {
- border: 1px solid rgb(90, 90, 90);
- transition: 0.2s;
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/ExploreLoading.tsx b/apps/portal/src/components/legacy/widgets/ExploreLoading.tsx
deleted file mode 100644
index 7a2a4c147..000000000
--- a/apps/portal/src/components/legacy/widgets/ExploreLoading.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-import styled from '@emotion/styled'
-
-import { device } from '@/util/breakpoints'
-
-/** @deprecated */
-export const ExploreTagLoading = styled(({ className }: { className?: string }) => {
- return (
-
-
Talisman is the coolest 🍜. The explore page will help you find all the Dapps/Daos and Applications.
-
- )
-})`
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- width: 87vw;
- margin-bottom: 2rem;
-
- @media ${device.md} {
- width: 100%;
- }
-
- > div {
- font-size: 1.25rem;
- margin: 0.5rem 0.5rem 0 0;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0.5rem 1rem;
- border-radius: 1rem;
- cursor: pointer;
- transition: 0.2s;
- color: transparent;
-
- animation: shimmer 1s infinite;
- background: linear-gradient(90deg, rgba(30, 30, 30, 1) 4%, rgba(60, 60, 60, 1) 25%, rgba(30, 30, 30, 1) 36%);
- background-size: 4000px 100%;
- }
-
- @keyframes shimmer {
- 0% {
- background-position: -600px 0;
- }
- 100% {
- background-position: 1000px 0;
- }
- }
-`
-
-/** @deprecated */
-export const ExploreCardLoading = styled(({ className, isLoading }: { className?: string; isLoading?: boolean }) => {
- return (
-
- {Array.from({ length: 3 }).map((_, i) => (
-
- ))}
-
- )
-})`
- display: grid;
-
- grid-template-columns: repeat(3, 1fr);
-
- @media ${device.sm} {
- grid-template-columns: repeat(3, 1fr);
- width: 87vw;
- }
-
- @media ${device.md} {
- grid-template-columns: repeat(3, 1fr);
- width: 100%;
- }
-
- @media ${device.lg} {
- grid-template-columns: repeat(12, 1fr);
- }
-
- grid-gap: 2.5rem;
-`
-
-const Card = styled(({ className }: { className?: string; isLoading?: boolean }) => {
- return (
-
- )
-})`
- cursor: pointer;
- background: #1e1e1e;
- border-radius: 1rem;
- overflow: hidden;
- grid-column: span 3;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- transition: 0.2s;
-
- .card-body {
- flex-grow: 2;
- justify-content: space-between;
-
- display: flex;
- flex-direction: column;
-
- animation: ${props => (props.isLoading ? 'shimmer 1s infinite' : 'none')};
- background: ${props =>
- props.isLoading
- ? 'linear-gradient(90deg, rgba(30, 30, 30, 1) 4%, rgba(60, 60, 60, 1) 25%, rgba(30, 30, 30, 1) 36%)'
- : '#1e1e1e'};
- background-size: 2000px 100%;
-
- padding: 2rem;
- }
-
- .card-header {
- height: 175px;
- overflow: hidden;
- position: relative;
-
- animation: ${props => (props.isLoading ? 'shimmer 1s infinite' : 'none')};
- background: ${props =>
- props.isLoading
- ? 'linear-gradient(90deg, rgba(24, 24, 24, 1) 4%, rgba(50, 50, 50, 1) 25%, rgba(24, 24, 24, 1) 36%);'
- : '#222'};
- background-size: 2000px 100%;
- }
-
- @keyframes shimmer {
- 0% {
- background-position: -1000px 0;
- }
- 100% {
- background-position: 400px 0;
- }
- }
-
- height: 450px;
-
- :nth-child(-n + 3) {
- grid-column: span 3;
- @media ${device.lg} {
- grid-column: span 4;
- }
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/ParachainAsset.tsx b/apps/portal/src/components/legacy/widgets/ParachainAsset.tsx
deleted file mode 100644
index 5c2fa9864..000000000
--- a/apps/portal/src/components/legacy/widgets/ParachainAsset.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import styled from '@emotion/styled'
-
-import { useParachainAssets } from '@/libs/talisman'
-import useImageWithFallback from '@/util/useImageWithFallback'
-
-type ImageProps = {
- id: string
- className?: string
- type: string
-}
-
-const fallbackMap = {
- card: 'https://raw.githubusercontent.com/TalismanSociety/chaindata/v3/assets/promo/generic-card.png',
- logo: 'https://raw.githubusercontent.com/TalismanSociety/chaindata/v3/assets/tokens/unknown.svg',
-}
-
-/** @deprecated */
-export const ParachainAsset = styled(({ id, type, className }: ImageProps) => {
- const assets = useParachainAssets(id)
- const imageSrc = useImageWithFallback(assets[type], fallbackMap[type as keyof typeof fallbackMap])
- return (
-
- )
-})`
- &[data-type='logo'] {
- font-size: ${({ size = 8 }: { size?: number }) => `${size}rem`};
- width: 1em;
- height: 1em;
- border-radius: 50%;
- display: block;
- }
-`
diff --git a/apps/portal/src/components/legacy/widgets/ParachainLinks.tsx b/apps/portal/src/components/legacy/widgets/ParachainLinks.tsx
deleted file mode 100644
index 447cc50eb..000000000
--- a/apps/portal/src/components/legacy/widgets/ParachainLinks.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import styled from '@emotion/styled'
-
-import { Pill } from '@/components/legacy/Pill'
-import { useParachainDetailsById } from '@/libs/talisman'
-
-export type LinksProps = {
- id: number | string
- className?: string
-}
-
-/** @deprecated */
-export const ParachainLinks = styled(({ id, className }: LinksProps) => {
- const { parachainDetails: { links = {} } = {} } = useParachainDetailsById(id)
-
- return (
-
- )
-})`
- display: flex;
- flex-wrap: wrap;
- gap: 1rem;
- align-items: center;
-`
diff --git a/apps/portal/src/components/legacy/widgets/WalletCrowdloans.tsx b/apps/portal/src/components/legacy/widgets/WalletCrowdloans.tsx
deleted file mode 100644
index 3f9c06923..000000000
--- a/apps/portal/src/components/legacy/widgets/WalletCrowdloans.tsx
+++ /dev/null
@@ -1,302 +0,0 @@
-import type { SkeletonProps } from '@talismn/ui/atoms/Skeleton'
-import { css } from '@emotion/react'
-import styled from '@emotion/styled'
-import { Chip, TonalChip } from '@talismn/ui/atoms/Chip'
-import { Skeleton } from '@talismn/ui/atoms/Skeleton'
-import { useSurfaceColor } from '@talismn/ui/atoms/Surface'
-import { Text } from '@talismn/ui/atoms/Text'
-import { ListItem } from '@talismn/ui/molecules/ListItem'
-import { encodeAnyAddress, planckToTokens } from '@talismn/util'
-import { Clock, Eye, Lock } from '@talismn/web-icons'
-import BigNumber from 'bignumber.js'
-import { Suspense, useCallback, useMemo } from 'react'
-import { useTranslation } from 'react-i18next'
-import { Link, useNavigate } from 'react-router-dom'
-import { useRecoilValue, useRecoilValueLoadable } from 'recoil'
-
-import type { GqlContribution } from '@/libs/crowdloans'
-import { Countdown } from '@/components/legacy/Countdown'
-import { PanelSection } from '@/components/legacy/Panel'
-import { Pendor } from '@/components/legacy/Pendor'
-import { ParachainAsset } from '@/components/legacy/widgets/ParachainAsset'
-import { AccountIcon } from '@/components/molecules/AccountIcon'
-import { SectionHeader } from '@/components/molecules/SectionHeader'
-import { AnimatedFiatNumber } from '@/components/widgets/AnimatedFiatNumber'
-import { RedactableBalance } from '@/components/widgets/RedactableBalance'
-import { WithdrawCrowdloanWidget } from '@/components/widgets/WithdrawCrowdloanWidget'
-import { selectedSubstrateAccountsState, substrateAccountsState } from '@/domains/accounts/recoils'
-import { chainsState, tokenPriceState } from '@/domains/chains/recoils'
-import { useTotalCrowdloanTotalFiatAmount } from '@/domains/crowdloans/hooks'
-import crowdloanDataState from '@/libs/@talisman-crowdloans/provider'
-import { useCrowdloanContributions } from '@/libs/crowdloans'
-import { calculateGqlCrowdloanPortfolioAmounts, useTaggedAmountsInPortfolio } from '@/libs/portfolio'
-import { useParachainDetailsById } from '@/libs/talisman'
-import { supportedRelayChainsState } from '@/libs/talisman/util/_config'
-import { formatCommas, truncateAddress } from '@/util/helpers'
-
-const GqlCrowdloanItem = styled(
- ({ contribution, className }: { contribution: GqlContribution; className?: string }) => {
- const { t } = useTranslation()
- const surfaceColor = useSurfaceColor()
-
- const accounts = useRecoilValue(substrateAccountsState)
- const account = useMemo(
- () => accounts.find(account => encodeAnyAddress(account.address) === encodeAnyAddress(contribution.account.id)),
- [accounts, contribution.account]
- )
-
- const crowdloans = useRecoilValue(crowdloanDataState)
-
- const paraId = contribution.crowdloan.paraId
- const relayChains = useRecoilValue(supportedRelayChainsState)
- const relayChain = relayChains.find(chain => chain.genesisHash === contribution.relay.genesisHash)
- const chain = crowdloans.find(x => x.id === `${relayChain?.id ?? NaN}-${paraId}`)
-
- const { tokenSymbol: relayNativeToken, coingeckoId, tokenDecimals: relayTokenDecimals } = relayChain ?? {}
- const { name } = chain ?? {}
-
- const priceLoadable = useRecoilValueLoadable(tokenPriceState({ coingeckoId: coingeckoId! }))
-
- const relayTokenPrice = priceLoadable.valueMaybe()?.toString()
- const relayPriceLoading = priceLoadable.state === 'loading'
-
- const relayTokenSymbol = relayNativeToken ?? 'Planck'
- const contributedTokens = planckToTokens(contribution.amount, relayTokenDecimals ?? 0)
- const contributedUsd = new BigNumber(contributedTokens).times(relayTokenPrice ?? 0).toString()
-
- const portfolioAmounts = useMemo(
- () => calculateGqlCrowdloanPortfolioAmounts([contribution], relayTokenDecimals, relayTokenPrice),
- [contribution, relayTokenDecimals, relayTokenPrice]
- )
-
- useTaggedAmountsInPortfolio(portfolioAmounts)
-
- const parachainId = `${relayChain?.id ?? NaN}-${paraId}`
- const { parachainDetails } = useParachainDetailsById(parachainId)
- const linkToCrowdloan = parachainDetails?.slug ? `/crowdloans/${parachainDetails?.slug}` : `/crowdloans`
-
- const navigate = useNavigate()
- const chains = useRecoilValue(chainsState)
- const goToStaking = useCallback(() => {
- const relayChainId = chains.find(({ genesisHash }) => genesisHash === relayChain?.genesisHash)?.id
- if (relayChainId && account?.address)
- navigate(`/staking?action=stake&chain=${relayChainId}&account=${account.address}&amount=${contributedTokens}`)
- }, [account?.address, chains, contributedTokens, navigate, relayChain?.genesisHash])
-
- // hide returned contributions which were unlocked more than 30 days ago
- if (contribution.blockNumber === null || contribution.oldAndReturned) return null
-
- const actions = (() => {
- if (contribution.isLocked) return null
- if (account?.readonly)
- return (
- <>
-
-
-
{t('Followed account')}
-
-
- {contribution.isFundsReturned && {t('Withdrawn')}
}
- >
- )
-
- if (contribution.isFundsReturned)
- return (
- <>
- {t('Stake')}
-
- {t('Withdrawn')}
- >
- )
-
- return (
- <>
-
- {({ onToggleOpen }) => {t('Withdraw & Stake')}}
-
-
- {({ onToggleOpen }) => {t('Withdraw')}}
-
- >
- )
- })()
-
- return (
-
-
- }
- headlineContent={
- name ?? [relayChain?.name, t('Parachain'), parachainId?.split('-')?.[1]].filter(Boolean).join(' ')
- }
- supportingContent={
- <>
-
- {account && }
-
-
- {account?.name ??
- truncateAddress(encodeAnyAddress(contribution.account.id, relayChain?.accountPrefix ?? 42))}
-
-
-
- >
- }
- trailingContent={
- <>
- {contribution.isLocked && (
-
- )}
-
-
-
- {contributedTokens && formatCommas(Number(contributedTokens))} {relayTokenSymbol}
- {' '}
-
-
-
-
-
- {contributedUsd && }
-
-
-
-
- >
- }
- css={{ backgroundColor: surfaceColor }}
- />
-
-
- {actions}
-
-
- )
- }
-)``
-
-const GqlCrowdloanItemSkeleton = (props: SkeletonProps) => {
- const surfaceColor = useSurfaceColor()
- return (
-
- }
- headlineContent={
-
-
-
- }
- supportingContent={
-
-
-
- }
- trailingContent={
-
-
-
-
-
-
- }
- />
-
- )
-}
-
-const SuspendableCrowdloans = ({ className }: { className?: string }) => {
- const { t } = useTranslation()
- const accounts = useRecoilValue(selectedSubstrateAccountsState)
- const { sortedGqlContributions, hydrated: contributionsHydrated } = useCrowdloanContributions(
- useMemo(() => accounts.map(x => x.address), [accounts])
- )
- const crowdloansUsd = useTotalCrowdloanTotalFiatAmount()
-
- return (
-
- } />
- {!contributionsHydrated ? (
-
- ) : sortedGqlContributions.length < 1 ? (
- {t('You have not contributed to any recent crowdloans')}
- ) : (
-
- {sortedGqlContributions.map(contribution => (
-
- ))}
-
- )}
-
- )
-}
-
-/** @deprecated */
-export const WalletCrowdloans = ({ className }: { className?: string }) => (
-
-
-
-)
diff --git a/apps/portal/src/components/legacy/widgets/useCrowdloanFilter.tsx b/apps/portal/src/components/legacy/widgets/useCrowdloanFilter.tsx
deleted file mode 100644
index 0cfd5b80b..000000000
--- a/apps/portal/src/components/legacy/widgets/useCrowdloanFilter.tsx
+++ /dev/null
@@ -1,153 +0,0 @@
-import { filter, find, orderBy } from 'lodash'
-import { useEffect, useMemo, useState } from 'react'
-import { useTranslation } from 'react-i18next'
-
-import { useLatestCrowdloans, useParachainsDetailsIndexedById } from '@/libs/talisman'
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-type Item = { crowdloan: any; parachainDetails?: any }
-
-const orderOptions = [
- {
- key: 'raised_desc',
- value: 'Raised',
- cb: (items: Item[]) => orderBy(items, ['crowdloan.raised'], ['desc']),
- },
- {
- key: 'id_asc',
- value: 'Oldest',
- cb: (items: Item[]) => orderBy(items, ['crowdloan.blockNum'], ['asc']),
- },
- {
- key: 'id_desc',
- value: 'Newest',
- cb: (items: Item[]) => orderBy(items, ['crowdloan.blockNum'], ['desc']),
- },
- {
- key: 'name_asc',
- value: 'A⇢Z',
- cb: (items: Item[]) => orderBy(items, ['parachainDetails.name'], ['asc']),
- },
- {
- key: 'name_desc',
- value: 'Z⇢A',
- cb: (items: Item[]) => orderBy(items, ['parachainDetails.name'], ['desc']),
- },
-]
-
-const statusOptions = [
- {
- key: 'all',
- value: 'All',
- cb: (items: Item[]) => items,
- },
- {
- key: 'active',
- value: 'Active',
- cb: (items: Item[]) => filter(items, item => ['active', 'capped'].includes(item.crowdloan.uiStatus)),
- },
- {
- key: 'winner',
- value: 'Winner',
- cb: (items: Item[]) => filter(items, item => item.crowdloan.uiStatus === 'winner'),
- },
- {
- key: 'ended',
- value: 'Ended',
- cb: (items: Item[]) => filter(items, item => item.crowdloan.uiStatus === 'ended'),
- },
-]
-
-const networkOptions = [
- {
- key: 'all',
- value: 'All',
- cb: (items: Item[]) => filter(items, item => !!item?.parachainDetails?.id),
- },
- {
- key: 'dot',
- value: 'Polkadot',
- cb: (items: Item[]) => filter(items, item => item?.parachainDetails?.id.split('-')[0] === '0'),
- },
- {
- key: 'ksm',
- value: 'Kusama',
- cb: (items: Item[]) => filter(items, item => item?.parachainDetails?.id.split('-')[0] === '2'),
- },
-]
-
-/** @deprecated */
-export const useCrowdloanFilter = () => {
- const { t } = useTranslation('filters')
- const { crowdloans, hydrated } = useLatestCrowdloans()
- const { parachains } = useParachainsDetailsIndexedById()
- const items = useMemo(
- () =>
- crowdloans
- .map(crowdloan => ({ crowdloan, parachainDetails: parachains[crowdloan.parachain.paraId] }))
- .filter(({ parachainDetails }) => !!parachainDetails),
- [crowdloans, parachains]
- )
-
- const [filteredItems, setFilteredItems] = useState- ([])
- const [searchFilter, setSearchFilter] = useState('')
- const [orderFilter, setOrderFilter] = useState(orderOptions[0]?.key)
- const [statusFilter, setStatusFilter] = useState(statusOptions[1]?.key)
- const [networkFilter, setNetworkFilter] = useState(networkOptions[0]?.key)
- const [loading, setLoading] = useState(true)
-
- // do searchy/filtery stuff
- useEffect(() => {
- if (!hydrated) return
-
- // filter by status
- const byStatus = find(statusOptions, { key: statusFilter })?.cb(items) ?? []
-
- // filter by network
- const networkFilterCb = find(networkOptions, { key: networkFilter })?.cb
- const byNetwork = networkFilterCb ? networkFilterCb(byStatus) : byStatus
-
- // searching
- const bySearch =
- searchFilter !== ''
- ? byNetwork.filter(item => item.parachainDetails?.name.toLowerCase().includes(searchFilter.toLowerCase()))
- : byNetwork
-
- // ordering
- const orderCallback = find(orderOptions, { key: orderFilter })?.cb
- const byOrder = orderCallback ? orderCallback(bySearch) : bySearch
-
- setFilteredItems(byOrder)
- setLoading(false)
- }, [hydrated, items, networkFilter, orderFilter, searchFilter, statusFilter])
-
- const filteredCrowdloans = useMemo(() => filteredItems.map(({ crowdloan }) => crowdloan), [filteredItems])
-
- return {
- crowdloans: filteredCrowdloans,
- loading,
- count: {
- total: crowdloans?.length,
- filtered: filteredItems?.length,
- },
- filterProps: {
- search: searchFilter,
- order: orderFilter,
- status: statusFilter,
- network: networkFilter,
- setSearch: setSearchFilter,
- setOrder: setOrderFilter,
- setStatus: setStatusFilter,
- setNetwork: setNetworkFilter,
- orderOptions: orderOptions.map(({ key, value }) => ({ key, value: t(value) })),
- statusOptions: statusOptions.map(({ key, value }) => ({ key, value: t(value) })),
- networkOptions: networkOptions.map(({ key, value }) => ({ key, value: t(value) })),
- hasFilter: statusFilter !== 'all' || searchFilter !== '',
- reset: () => {
- setSearchFilter('')
- setStatusFilter(statusOptions[0]?.key)
- setNetworkFilter(networkOptions[0]?.key)
- },
- },
- }
-}
diff --git a/apps/portal/src/components/legacy/widgets/useFetchDapps.tsx b/apps/portal/src/components/legacy/widgets/useFetchDapps.tsx
deleted file mode 100644
index 87f85052a..000000000
--- a/apps/portal/src/components/legacy/widgets/useFetchDapps.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-
-import { useEffect, useState } from 'react'
-
-export type Dapp = { id: string; name: string; description: string; logoUrl: string; tags: string[] }
-
-/** @deprecated */
-export const useFetchDapps = () => {
- const [dapps, setDapps] = useState([])
- const [loading, setLoading] = useState(true)
- const [error, setError] = useState(undefined)
- const [tags, setTags] = useState(['All', '⭐ Featured']) // Hardcoded Featured for now so it appears first.
-
- useEffect(() => {
- const fetchDapps = async () => {
- try {
- void fetch(`https://api.baserow.io/api/database/rows/table/141541/?user_field_names=true`, {
- method: 'GET',
- headers: {
- Authorization: `Token ${import.meta.env.VITE_BASEROW_EXPLORE_AUTH}`,
- },
- })
- .then(async res => await res.json())
- .then((data: { results: any[] }) => {
- // Define a type for each item
- const items = data?.results
- .map((item: any) => {
- if (!item.name || !item.url || !item.logo?.[0]?.url) {
- return undefined
- }
-
- return {
- id: item.id,
- name: item.name,
- description: item.description,
- url: item.url,
- tags: item.tags?.map((tag: any) => tag.value) ?? [],
- envs: item.envs,
- score: item.score,
- logoUrl: item.logo[0].url,
- }
- })
- .filter(item => item !== undefined)
-
- setTags(prevTags =>
- Array.from(new Set([...prevTags, ...items.flatMap(item => item?.tags)])).sort((a, b) => {
- if (a.match(/^other$/i)) return 1
- if (b.match(/^other$/i)) return -1
- return 0
- })
- )
-
- const sortedItems = items.slice().sort((a: any, b: any) => {
- if (a.tags.includes('⭐ Featured') && b.tags.includes('⭐ Featured')) {
- return b.score - a.score
- } else if (a.tags.includes('⭐ Featured')) {
- return -1
- } else if (b.tags.includes('⭐ Featured')) {
- return 1
- } else {
- return b.score - a.score
- }
- }) as Dapp[]
-
- setDapps(sortedItems)
- setLoading(false)
- })
- } catch (error: unknown) {
- setError(error)
- }
- }
-
- void fetchDapps()
- }, [])
-
- return { dapps, loading, error, tags }
-}
diff --git a/apps/portal/src/components/recipes/AccountValueInfo.tsx b/apps/portal/src/components/recipes/AccountValueInfo.tsx
index 44e06863c..2b69d1b95 100644
--- a/apps/portal/src/components/recipes/AccountValueInfo.tsx
+++ b/apps/portal/src/components/recipes/AccountValueInfo.tsx
@@ -7,7 +7,7 @@ import { type ReactNode } from 'react'
import type { Account } from '@/domains/accounts/recoils'
import { AccountIcon } from '@/components/molecules/AccountIcon'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
export type AccountValueInfoProps = {
account?: Account
@@ -63,7 +63,7 @@ export const AccountValueInfo = ({ account, balance }: AccountValueInfoProps) =>
css={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '0.8rem', width: '100%' }}
>
- {account === undefined ? 'My accounts' : account.name ?? shortenAddress(account.address)}
+ {account === undefined ? 'My accounts' : account.name ?? truncateAddress(account.address)}
diff --git a/apps/portal/src/components/recipes/AddReadOnlyAccountDialog.tsx b/apps/portal/src/components/recipes/AddReadOnlyAccountDialog.tsx
index a0e7f207b..c266f1d1f 100644
--- a/apps/portal/src/components/recipes/AddReadOnlyAccountDialog.tsx
+++ b/apps/portal/src/components/recipes/AddReadOnlyAccountDialog.tsx
@@ -11,7 +11,7 @@ import { TextInput } from '@talismn/ui/molecules/TextInput'
import Loader from '@/assets/icons/loader.svg?react'
import { isNilOrWhitespace } from '@/util/nil'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
export type AddReadOnlyAccountDialogProps = {
open?: boolean
@@ -33,7 +33,7 @@ const PopularAccount = (props: { address: string; name: string; description?: st
}
headlineContent={props.name}
- supportingContent={props.description ?? shortenAddress(props.address)}
+ supportingContent={props.description ?? truncateAddress(props.address)}
css={{ borderRadius: '1.2rem', backgroundColor: useSurfaceColor() }}
/>
@@ -71,7 +71,7 @@ export const AddReadOnlyAccountDialog = Object.assign(
}
headlineContent={isNilOrWhitespace(props.name) ? undefined : props.name}
- supportingContent={shortenAddress(props.resultingAddress)}
+ supportingContent={truncateAddress(props.resultingAddress)}
css={{ marginTop: '0.8rem', border: `2px solid ${theme.color.outlineVariant}`, borderRadius: '0.8rem' }}
/>
)}
diff --git a/apps/portal/src/components/recipes/ExtrinsicDetailsSideSheet.tsx b/apps/portal/src/components/recipes/ExtrinsicDetailsSideSheet.tsx
index edfd6c3e5..7cbe498ce 100644
--- a/apps/portal/src/components/recipes/ExtrinsicDetailsSideSheet.tsx
+++ b/apps/portal/src/components/recipes/ExtrinsicDetailsSideSheet.tsx
@@ -14,7 +14,7 @@ import { ObjectView } from 'react-object-view'
import type { Account } from '@/domains/accounts/recoils'
import { AccountIcon } from '@/components/molecules/AccountIcon'
import { copyAddressToClipboard, copyExtrinsicHashToClipboard } from '@/domains/common/utils/clipboard'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
export type ExtrinsicDetailsSideSheetProps = {
onRequestDismiss: () => unknown
@@ -51,8 +51,8 @@ const AccountItem = (props: { account: Account }) => (
}
- headlineContent={props.account.name ?? shortenAddress(props.account.address)}
- supportingContent={props.account.name !== undefined && shortenAddress(props.account.address)}
+ headlineContent={props.account.name ?? truncateAddress(props.account.address)}
+ supportingContent={props.account.name !== undefined && truncateAddress(props.account.address)}
onClick={() => {
void copyAddressToClipboard(props.account.address)
}}
@@ -96,7 +96,7 @@ export const ExtrinsicDetailsSideSheet = (props: ExtrinsicDetailsSideSheetProps)
}}
>
- {shortenAddress(props.hash, 6)}
+ {truncateAddress(props.hash, 6, 6)}
@@ -121,7 +121,7 @@ export const ExtrinsicDetailsSideSheet = (props: ExtrinsicDetailsSideSheetProps)
>
{' '}
- {shortenAddress(props.signer.address)}
+ {truncateAddress(props.signer.address)}
diff --git a/apps/portal/src/components/recipes/StakePosition.tsx b/apps/portal/src/components/recipes/StakePosition.tsx
index 6b1c136fd..b4ad73ede 100644
--- a/apps/portal/src/components/recipes/StakePosition.tsx
+++ b/apps/portal/src/components/recipes/StakePosition.tsx
@@ -20,7 +20,7 @@ import { AccountIcon } from '@/components/molecules/AccountIcon'
import { AssetLogoWithChain } from '@/components/recipes/AssetLogoWithChain'
import { StakeStatusIndicator } from '@/components/recipes/StakeStatusIndicator'
import { Account } from '@/domains/accounts/recoils'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
import { StakePositionSkeleton } from './StakePosition.skeleton'
@@ -247,7 +247,7 @@ export const StakePosition = Object.assign(
},
}}
>
- {props.account.name ?? shortenAddress(props.account.address)}
+ {props.account.name ?? truncateAddress(props.account.address)}
@@ -479,7 +479,7 @@ export const StakePositionErrorBoundary = (props: StakePositionErrorBoundaryProp
},
}}
>
- {props.account.name ?? shortenAddress(props.account.address)}
+ {props.account.name ?? truncateAddress(props.account.address)}
diff --git a/apps/portal/src/components/recipes/TransactionLineItem.tsx b/apps/portal/src/components/recipes/TransactionLineItem.tsx
index 1b1a025d8..870623f08 100644
--- a/apps/portal/src/components/recipes/TransactionLineItem.tsx
+++ b/apps/portal/src/components/recipes/TransactionLineItem.tsx
@@ -12,7 +12,7 @@ import { Fragment, useMemo } from 'react'
import type { Account } from '@/domains/accounts/recoils'
import { AccountIcon } from '@/components/molecules/AccountIcon'
import { getSubstrateModuleColor } from '@/util/getSubstrateModuleColor'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
type TokenAmount = {
amount: string
@@ -109,7 +109,7 @@ export const TransactionLineItem = (props: TransactionLineItemProps) => {
- {props.signer === undefined ? props.chain : props.signer.name ?? shortenAddress(props.signer.address)}
+ {props.signer === undefined ? props.chain : props.signer.name ?? truncateAddress(props.signer.address)}
}
headlineContent={props.name}
- supportingContent={props.description ?? shortenAddress(props.address)}
+ supportingContent={props.description ?? truncateAddress(props.address)}
css={{ borderRadius: '1.2rem', backgroundColor: useSurfaceColor() }}
/>
diff --git a/apps/portal/src/components/widgets/AccountConnectionGuard.tsx b/apps/portal/src/components/widgets/AccountConnectionGuard.tsx
index 6e884daae..dce7b54f0 100644
--- a/apps/portal/src/components/widgets/AccountConnectionGuard.tsx
+++ b/apps/portal/src/components/widgets/AccountConnectionGuard.tsx
@@ -6,7 +6,7 @@ import { Welcome } from '@/components/recipes/Welcome'
import { popularAccounts } from '@/domains/accounts/consts'
import { lookupAccountAddressState, readOnlyAccountsState } from '@/domains/accounts/recoils'
import { useHasActiveWalletConnection, useWalletConnectionInitialised } from '@/domains/extension/main'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
import { walletConnectionSideSheetOpenState } from './WalletConnectionSideSheet'
@@ -42,7 +42,7 @@ export const AccountConnectionGuard = ({ children, noSuspense }: AccountConnecti
popularAccounts={popularAccounts.map((x, index) => (
setLookupAddress(x.address)}
diff --git a/apps/portal/src/components/widgets/AccountSelector.tsx b/apps/portal/src/components/widgets/AccountSelector.tsx
index 9d6bcc38c..da6a960c2 100644
--- a/apps/portal/src/components/widgets/AccountSelector.tsx
+++ b/apps/portal/src/components/widgets/AccountSelector.tsx
@@ -11,7 +11,7 @@ import { AccountIcon } from '@/components/molecules/AccountIcon'
import { walletConnectionSideSheetOpenState } from '@/components/widgets/WalletConnectionSideSheet'
import { type Account } from '@/domains/accounts/recoils'
import { useHasActiveWalletConnection } from '@/domains/extension/main'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
export type AccountSelectorProps = {
accounts: Account[]
@@ -68,12 +68,12 @@ export const AccountSelector = ({
leadingIcon={}
supportingContent={
selectedAccount && selectedAccount.name
- ? shortenAddress(encodeAnyAddress(selectedAccount.address, prefix))
+ ? truncateAddress(encodeAnyAddress(selectedAccount.address, prefix))
: ''
}
headlineContent={
selectedAccount
- ? selectedAccount.name ?? shortenAddress(encodeAnyAddress(selectedAccount.address, prefix))
+ ? selectedAccount.name ?? truncateAddress(encodeAnyAddress(selectedAccount.address, prefix))
: ''
}
/>
@@ -92,11 +92,11 @@ export const AccountSelector = ({
- {x.name ?? shortenAddress(encodeAnyAddress(x.address, prefix))}
+ {x.name ?? truncateAddress(encodeAnyAddress(x.address, prefix))}
{x.name ? (
- {shortenAddress(encodeAnyAddress(x.address, prefix))}
+ {truncateAddress(encodeAnyAddress(x.address, prefix))}
) : null}
diff --git a/apps/portal/src/components/widgets/AccountsManagementMenu.tsx b/apps/portal/src/components/widgets/AccountsManagementMenu.tsx
index 6d1133ed5..ab21eb58b 100644
--- a/apps/portal/src/components/widgets/AccountsManagementMenu.tsx
+++ b/apps/portal/src/components/widgets/AccountsManagementMenu.tsx
@@ -28,7 +28,7 @@ import { fiatBalanceGetterState, portfolioBalancesFiatSumState } from '@/domains
import { copyAddressToClipboard } from '@/domains/common/utils/clipboard'
import { useOnChainId } from '@/libs/onChainId/hooks/useOnChainId'
import { Maybe } from '@/util/monads'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
const EvmChip = () => {
const theme = useTheme()
@@ -78,7 +78,7 @@ const AccountsManagementAddress = ({
{onChainId && (
{onChainId}
)}
-
{name ?? shortenAddress(address)}
+
{name ?? truncateAddress(address)}
>
)
}
diff --git a/apps/portal/src/components/widgets/RemoveWatchedAccountConfirmationDialog.tsx b/apps/portal/src/components/widgets/RemoveWatchedAccountConfirmationDialog.tsx
index 2a6b49a10..83a8c964a 100644
--- a/apps/portal/src/components/widgets/RemoveWatchedAccountConfirmationDialog.tsx
+++ b/apps/portal/src/components/widgets/RemoveWatchedAccountConfirmationDialog.tsx
@@ -5,7 +5,7 @@ import { RemoveWatchedAccountConfirmationDialog as RemoveWatchedAccountConfirmat
import { useSetReadonlyAccounts } from '@/domains/accounts/hooks'
import { type ReadonlyAccount } from '@/domains/accounts/recoils'
import { isNilOrWhitespace } from '@/util/nil'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
export type RemoveWatchedAccountConfirmationDialogProps = {
account: ReadonlyAccount
@@ -22,7 +22,7 @@ export const RemoveWatchedAccountConfirmationDialog = (props: RemoveWatchedAccou
setOpen(false), [])}
- name={isNilOrWhitespace(props.account.name) ? shortenAddress(props.account.address) : props.account.name}
+ name={isNilOrWhitespace(props.account.name) ? truncateAddress(props.account.address) : props.account.name}
onConfirm={useCallback(() => {
remove(props.account)
setOpen(false)
diff --git a/apps/portal/src/components/widgets/SeparatedAccountSelector.tsx b/apps/portal/src/components/widgets/SeparatedAccountSelector.tsx
index 317886ab7..2dbeb1082 100644
--- a/apps/portal/src/components/widgets/SeparatedAccountSelector.tsx
+++ b/apps/portal/src/components/widgets/SeparatedAccountSelector.tsx
@@ -15,7 +15,7 @@ import { walletConnectionSideSheetOpenState } from '@/components/widgets/WalletC
import { evmAccountsState, substrateAccountsState } from '@/domains/accounts/recoils'
import { AccountWithBtc, isBtcAddress } from '@/util/btc'
import { cn } from '@/util/cn'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
type Props = {
allowInput?: boolean
@@ -52,11 +52,11 @@ const AccountRow: React.FC<{
'text-[14px]': formattedAddress.startsWith('0x'),
})}
>
- {name ?? shortenAddress(formattedAddress, 6)}
+ {name ?? truncateAddress(formattedAddress, 6, 6)}
{name ? (
- {shortenAddress(formattedAddress, 6)}
+ {truncateAddress(formattedAddress, 6, 6)}
) : null}
diff --git a/apps/portal/src/components/widgets/WithdrawCrowdloanWidget.tsx b/apps/portal/src/components/widgets/WithdrawCrowdloanWidget.tsx
deleted file mode 100644
index 5c969c80b..000000000
--- a/apps/portal/src/components/widgets/WithdrawCrowdloanWidget.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import type { ReactNode } from 'react'
-import { useCallback, useEffect, useMemo, useState } from 'react'
-import { useRecoilValueLoadable } from 'recoil'
-
-import type { Relaychain } from '@/libs/talisman/util/_config'
-import { WithdrawCrowdloanDialog } from '@/components/recipes/WithdrawCrowdloanDialog'
-import { type Account } from '@/domains/accounts/recoils'
-import { useExtrinsic } from '@/domains/common/hooks/useExtrinsic'
-import { substrateApiState } from '@/domains/common/recoils/api'
-
-export type WithdrawCrowdloanWidgetProps = {
- account?: Account
- relayChain?: Relaychain
- paraId?: string
- amount?: string
- stakeAfterWithdrawn?: boolean
- goToStaking?: () => void
- children: (props: { onToggleOpen: () => unknown }) => ReactNode
-}
-
-export const WithdrawCrowdloanWidget = ({
- account,
- relayChain,
- paraId,
- amount,
- stakeAfterWithdrawn,
- goToStaking,
- children,
-}: WithdrawCrowdloanWidgetProps) => {
- const [open, setOpen] = useState(false)
-
- const apiLoadable = useRecoilValueLoadable(substrateApiState(relayChain?.rpc))
-
- const tx = useExtrinsic(
- useMemo(() => {
- const api = apiLoadable.valueMaybe()
-
- if (!open) return
- if (api === undefined) return
- if (account === undefined) return
- if (paraId === undefined) return
-
- return api.tx.crowdloan.withdraw(account.address, paraId)
- }, [open, account, apiLoadable, paraId])
- )
-
- const onRequestWithdraw = useCallback(async () => account && (await tx?.signAndSend(account.address)), [account, tx])
-
- useEffect(() => {
- if (tx?.state === 'loading') {
- if (tx?.contents === undefined) return
-
- // only close modal if we're doing a `withdraw` without a follow-up `stake`
- if (!stakeAfterWithdrawn) setOpen(false)
- }
- if (tx?.state === 'hasValue') {
- if (tx?.contents === undefined) return
-
- setOpen(false)
- if (stakeAfterWithdrawn && goToStaking) goToStaking()
- }
- if (tx?.state === 'hasError') {
- setOpen(false)
- }
- }, [goToStaking, stakeAfterWithdrawn, tx?.contents, tx?.state])
-
- return (
- <>
- setOpen(false), [])}
- onRequestWithdraw={onRequestWithdraw}
- />
- {children({
- onToggleOpen: useCallback(() => setOpen(x => !x), []),
- })}
- >
- )
-}
diff --git a/apps/portal/src/components/widgets/staking/dappStaking/DappPickerDialog.tsx b/apps/portal/src/components/widgets/staking/dappStaking/DappPickerDialog.tsx
index b2e39ec5e..f93ae5d80 100644
--- a/apps/portal/src/components/widgets/staking/dappStaking/DappPickerDialog.tsx
+++ b/apps/portal/src/components/widgets/staking/dappStaking/DappPickerDialog.tsx
@@ -11,7 +11,7 @@ import { useRecoilValue, waitForAll } from 'recoil'
import { useNativeTokenAmountState } from '@/domains/chains/recoils'
import { StakeLoadable } from '@/domains/staking/dappStaking/hooks/useStakeLoadable'
import { useRegisteredDappsState } from '@/domains/staking/dappStaking/recoils'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
type DappPickerDialogProps = {
title: ReactNode
@@ -73,7 +73,7 @@ const DappPickerDialog = (props: DappPickerDialogProps) => {
/>
)}
- {registeredDapp?.name ?? shortenAddress(address)}{' '}
+ {registeredDapp?.name ?? truncateAddress(address)}{' '}
diff --git a/apps/portal/src/components/widgets/staking/substrate/NominationPoolsStatisticsSideSheet.tsx b/apps/portal/src/components/widgets/staking/substrate/NominationPoolsStatisticsSideSheet.tsx
index fe6a84616..1e6222e23 100644
--- a/apps/portal/src/components/widgets/staking/substrate/NominationPoolsStatisticsSideSheet.tsx
+++ b/apps/portal/src/components/widgets/staking/substrate/NominationPoolsStatisticsSideSheet.tsx
@@ -28,7 +28,7 @@ import {
poolPayoutsState,
totalPoolPayoutsState,
} from '@/domains/staking/substrate/nominationPools/recoils'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
export type NominationPoolsStatisticsSideSheetProps = {
account: Account
@@ -90,8 +90,8 @@ const Stats = (props: {
}}
>
}
css={{ paddingRight: 0, paddingLeft: 0 }}
/>
diff --git a/apps/portal/src/components/widgets/staking/subtensor/DelegatePickerDialog.tsx b/apps/portal/src/components/widgets/staking/subtensor/DelegatePickerDialog.tsx
index 97b38ed7d..32be8abcf 100644
--- a/apps/portal/src/components/widgets/staking/subtensor/DelegatePickerDialog.tsx
+++ b/apps/portal/src/components/widgets/staking/subtensor/DelegatePickerDialog.tsx
@@ -11,7 +11,7 @@ import type { Account } from '@/domains/accounts/recoils'
import { useNativeTokenAmountState } from '@/domains/chains/recoils'
import { useDelegates } from '@/domains/staking/subtensor/hooks/useDelegates'
import { useStake } from '@/domains/staking/subtensor/hooks/useStake'
-import { shortenAddress } from '@/util/shortenAddress'
+import { truncateAddress } from '@/util/truncateAddress'
type DelegatePickerDialogProps = {
title: ReactNode
@@ -56,7 +56,7 @@ const DelegatePickerDialog = (props: DelegatePickerDialogProps) => {
) : null}
- {delegate?.name ?? shortenAddress(stake.hotkey)}{' '}
+ {delegate?.name ?? truncateAddress(stake.hotkey)}{' '}
diff --git a/apps/portal/src/components/widgets/swap/SwapTokenRow.tsx b/apps/portal/src/components/widgets/swap/SwapTokenRow.tsx
index 3cae1b90d..5ffb53d98 100644
--- a/apps/portal/src/components/widgets/swap/SwapTokenRow.tsx
+++ b/apps/portal/src/components/widgets/swap/SwapTokenRow.tsx
@@ -15,7 +15,7 @@ import { selectedCurrencyState } from '@/domains/balances/currency'
import { useCopied } from '@/hooks/useCopied'
import { useTokenRatesFromUsd } from '@/hooks/useTokenRatesFromUsd'
import { Decimal } from '@/util/Decimal'
-import { truncateAddress } from '@/util/helpers'
+import { truncateAddress } from '@/util/truncateAddress'
import { SwappableAssetWithDecimals } from './swap-modules/common.swap-module'
import { uniswapExtendedTokensList, uniswapSafeTokensList } from './swaps.api'
@@ -130,7 +130,7 @@ export const SwapTokenRow: React.FC
= ({
e.stopPropagation()}>
- {truncateAddress(erc20Address)}
+ {truncateAddress(erc20Address, 6)}
@@ -145,7 +145,7 @@ export const SwapTokenRow: React.FC = ({
}}
>
- {truncateAddress(erc20Address)}
+ {truncateAddress(erc20Address, 6)}
{copied ? (
diff --git a/apps/portal/src/domains/crowdloans/hooks.ts b/apps/portal/src/domains/crowdloans/hooks.ts
deleted file mode 100644
index 98817b468..000000000
--- a/apps/portal/src/domains/crowdloans/hooks.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { encodeAnyAddress } from '@talismn/util'
-import BigNumber from 'bignumber.js'
-import { useMemo } from 'react'
-import { useRecoilValue } from 'recoil'
-
-import { selectedSubstrateAccountsState } from '@/domains/accounts/recoils'
-import { usePortfolio } from '@/libs/portfolio'
-
-export const useTotalCrowdloanTotalFiatAmount = () => {
- const accounts = useRecoilValue(selectedSubstrateAccountsState)
- const { totalCrowdloansUsdByAddress } = usePortfolio()
- const genericAccounts = useMemo(
- () => accounts?.map(x => x.address).map(account => encodeAnyAddress(account, 42)),
- [accounts]
- )
- return useMemo(
- () =>
- Object.entries(totalCrowdloansUsdByAddress || {})
- .filter(([address]) => genericAccounts?.includes(address))
- .map(([, crowdloansUsd]) => crowdloansUsd)
- .reduce((prev, curr) => prev.plus(curr), new BigNumber(0))
- .toNumber(),
- [totalCrowdloansUsdByAddress, genericAccounts]
- )
-}
diff --git a/apps/portal/src/domains/extension/TalismanExtensionSynchronizer.tsx b/apps/portal/src/domains/extension/TalismanExtensionSynchronizer.tsx
index b9d754a78..bd58225e7 100644
--- a/apps/portal/src/domains/extension/TalismanExtensionSynchronizer.tsx
+++ b/apps/portal/src/domains/extension/TalismanExtensionSynchronizer.tsx
@@ -1,10 +1,12 @@
-import { parseCustomEvmErc20Tokens } from '../../hooks/useSetCustomTokens'
-import { customTokensConfig } from './customTokensConfig'
-import { useChaindataProvider, useEvmNetworks } from '@talismn/balances-react'
import type { CustomChain, CustomEvmNetwork, Token } from '@talismn/chaindata-provider'
+import { type CustomEvmErc20Token } from '@talismn/balances'
+import { useChaindataProvider, useEvmNetworks } from '@talismn/balances-react'
+import { githubUnknownTokenLogoUrl } from '@talismn/chaindata-provider'
import { unionBy } from 'lodash'
import { useEffect, useState } from 'react'
+import { CustomTokensConfig, customTokensConfig } from './customTokensConfig'
+
const windowInject = globalThis as typeof globalThis & {
talismanSub?: {
subscribeCustomSubstrateChains?: (cb: (chains: CustomChain[]) => unknown) => () => void
@@ -32,9 +34,34 @@ export const TalismanExtensionSynchronizer = () => {
}, [chaindataProvider])
useEffect(() => {
- const customTokens = parseCustomEvmErc20Tokens({ customTokensConfig: customTokensConfig, evmNetworks })
+ const customTokens = parseCustomEvmErc20Tokens({ customTokensConfig, evmNetworks })
chaindataProvider.setCustomTokens(unionBy(customTokens, walletTokens, 'id'))
}, [walletTokens, evmNetworks, chaindataProvider])
return null
}
+
+function parseCustomEvmErc20Tokens({
+ customTokensConfig,
+ evmNetworks,
+}: {
+ customTokensConfig: CustomTokensConfig
+ evmNetworks: ReturnType
+}): CustomEvmErc20Token[] {
+ const customTokens = customTokensConfig.map(
+ ({ evmChainId, symbol, decimals, contractAddress, coingeckoId, logo }): CustomEvmErc20Token => ({
+ id: `${evmChainId}-evm-erc20-${contractAddress}`.toLowerCase(),
+ type: 'evm-erc20',
+ isTestnet: evmNetworks[evmChainId]?.isTestnet || false,
+ symbol,
+ decimals,
+ logo: logo ?? githubUnknownTokenLogoUrl,
+ coingeckoId,
+ contractAddress,
+ evmNetwork: { id: evmChainId },
+ isCustom: true,
+ })
+ )
+
+ return customTokens
+}
diff --git a/apps/portal/src/domains/extension/customTokensConfig.ts b/apps/portal/src/domains/extension/customTokensConfig.ts
index 0a0f16424..bfeadbc60 100644
--- a/apps/portal/src/domains/extension/customTokensConfig.ts
+++ b/apps/portal/src/domains/extension/customTokensConfig.ts
@@ -1,4 +1,12 @@
-import { CustomTokensConfig } from '../../hooks/useSetCustomTokens'
+export type CustomTokensConfig = CustomTokenConfig[]
+export type CustomTokenConfig = {
+ evmChainId: string
+ contractAddress: string
+ symbol: string
+ decimals: number
+ coingeckoId?: string
+ logo?: string
+}
export const customTokensConfig: CustomTokensConfig = [
{
diff --git a/apps/portal/src/generated/gql/crowdloan/gql/fragment-masking.ts b/apps/portal/src/generated/gql/crowdloan/gql/fragment-masking.ts
deleted file mode 100644
index 25f868a30..000000000
--- a/apps/portal/src/generated/gql/crowdloan/gql/fragment-masking.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import type { DocumentTypeDecoration, ResultOf, TypedDocumentNode } from '@graphql-typed-document-node/core'
-import type { FragmentDefinitionNode } from 'graphql'
-
-import type { Incremental } from './graphql'
-
-export type FragmentType> =
- TDocumentType extends DocumentTypeDecoration
- ? [TType] extends [{ ' $fragmentName'?: infer TKey }]
- ? TKey extends string
- ? { ' $fragmentRefs'?: { [key in TKey]: TType } }
- : never
- : never
- : never
-
-// return non-nullable if `fragmentType` is non-nullable
-export function useFragment(
- _documentNode: DocumentTypeDecoration,
- fragmentType: FragmentType>
-): TType
-// return nullable if `fragmentType` is nullable
-export function useFragment(
- _documentNode: DocumentTypeDecoration,
- fragmentType: FragmentType> | null | undefined
-): TType | null | undefined
-// return array of non-nullable if `fragmentType` is array of non-nullable
-export function useFragment(
- _documentNode: DocumentTypeDecoration,
- fragmentType: ReadonlyArray>>
-): ReadonlyArray
-// return array of nullable if `fragmentType` is array of nullable
-export function useFragment(
- _documentNode: DocumentTypeDecoration,
- fragmentType: ReadonlyArray>> | null | undefined
-): ReadonlyArray | null | undefined
-export function useFragment(
- _documentNode: DocumentTypeDecoration,
- fragmentType:
- | FragmentType>
- | ReadonlyArray>>
- | null
- | undefined
-): TType | ReadonlyArray | null | undefined {
- return fragmentType as any
-}
-
-export function makeFragmentData, FT extends ResultOf>(
- data: FT,
- _fragment: F
-): FragmentType {
- return data as FragmentType
-}
-export function isFragmentReady(
- queryNode: DocumentTypeDecoration,
- fragmentNode: TypedDocumentNode,
- data: FragmentType, any>> | null | undefined
-): data is FragmentType {
- const deferredFields = (queryNode as { __meta__?: { deferredFields: Record } }).__meta__
- ?.deferredFields
-
- if (!deferredFields) return true
-
- const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined
- const fragName = fragDef?.name?.value
-
- const fields = (fragName && deferredFields[fragName]) || []
- return fields.length > 0 && fields.every(field => data && field in data)
-}
diff --git a/apps/portal/src/generated/gql/crowdloan/gql/gql.ts b/apps/portal/src/generated/gql/crowdloan/gql/gql.ts
deleted file mode 100644
index 9f63432d8..000000000
--- a/apps/portal/src/generated/gql/crowdloan/gql/gql.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/* eslint-disable */
-import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'
-
-import * as types from './graphql'
-
-/**
- * Map of all GraphQL operations in the project.
- *
- * This map has several performance disadvantages:
- * 1. It is not tree-shakeable, so it will include all operations in the project.
- * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
- * 3. It does not support dead code elimination, so it will add unused operations.
- *
- * Therefore it is highly recommended to use the babel or swc plugin for production.
- */
-const documents = {
- '\n query contributions($addresses: [String!]!) {\n contributions(where: { account: { id_in: $addresses } }, orderBy: id_ASC) {\n id\n crowdloan {\n id\n fundIndex\n fundAccount\n paraId\n\n depositor\n end\n cap\n firstPeriod\n lastPeriod\n lastBlock\n\n createdBlockNumber\n createdTimestamp\n\n dissolved\n dissolvedBlockNumber\n dissolvedTimestamp\n }\n account {\n id\n }\n amount\n returned\n blockNumber\n timestamp\n }\n }\n ':
- types.ContributionsDocument,
-}
-
-/**
- * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
- *
- *
- * @example
- * ```ts
- * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
- * ```
- *
- * The query argument is unknown!
- * Please regenerate the types.
- */
-export function graphql(source: string): unknown
-
-/**
- * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
- */
-export function graphql(
- source: '\n query contributions($addresses: [String!]!) {\n contributions(where: { account: { id_in: $addresses } }, orderBy: id_ASC) {\n id\n crowdloan {\n id\n fundIndex\n fundAccount\n paraId\n\n depositor\n end\n cap\n firstPeriod\n lastPeriod\n lastBlock\n\n createdBlockNumber\n createdTimestamp\n\n dissolved\n dissolvedBlockNumber\n dissolvedTimestamp\n }\n account {\n id\n }\n amount\n returned\n blockNumber\n timestamp\n }\n }\n '
-): (typeof documents)['\n query contributions($addresses: [String!]!) {\n contributions(where: { account: { id_in: $addresses } }, orderBy: id_ASC) {\n id\n crowdloan {\n id\n fundIndex\n fundAccount\n paraId\n\n depositor\n end\n cap\n firstPeriod\n lastPeriod\n lastBlock\n\n createdBlockNumber\n createdTimestamp\n\n dissolved\n dissolvedBlockNumber\n dissolvedTimestamp\n }\n account {\n id\n }\n amount\n returned\n blockNumber\n timestamp\n }\n }\n ']
-
-export function graphql(source: string) {
- return (documents as any)[source] ?? {}
-}
-
-export type DocumentType> = TDocumentNode extends DocumentNode<
- infer TType,
- any
->
- ? TType
- : never
diff --git a/apps/portal/src/generated/gql/crowdloan/gql/graphql.ts b/apps/portal/src/generated/gql/crowdloan/gql/graphql.ts
deleted file mode 100644
index e0ea1a14a..000000000
--- a/apps/portal/src/generated/gql/crowdloan/gql/graphql.ts
+++ /dev/null
@@ -1,768 +0,0 @@
-/* eslint-disable */
-import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'
-
-export type Maybe = T | null
-export type InputMaybe = Maybe
-export type Exact = { [K in keyof T]: T[K] }
-export type MakeOptional = Omit & { [SubKey in K]?: Maybe }
-export type MakeMaybe = Omit & { [SubKey in K]: Maybe }
-export type MakeEmpty = { [_ in K]?: never }
-export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }
-/** All built-in and custom scalars, mapped to their actual values */
-export type Scalars = {
- ID: { input: string; output: string }
- String: { input: string; output: string }
- Boolean: { input: boolean; output: boolean }
- Int: { input: number; output: number }
- Float: { input: number; output: number }
- /** Big number integer */
- BigInt: { input: any; output: any }
- /** A date-time string in simplified extended ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ) */
- DateTime: { input: any; output: any }
-}
-
-export type Account = {
- __typename?: 'Account'
- contributions: Array
- /** Account address */
- id: Scalars['String']['output']
-}
-
-export type AccountContributionsArgs = {
- limit?: InputMaybe
- offset?: InputMaybe
- orderBy?: InputMaybe>
- where?: InputMaybe
-}
-
-export type AccountEdge = {
- __typename?: 'AccountEdge'
- cursor: Scalars['String']['output']
- node: Account
-}
-
-export enum AccountOrderByInput {
- IdAsc = 'id_ASC',
- IdAscNullsFirst = 'id_ASC_NULLS_FIRST',
- IdDesc = 'id_DESC',
- IdDescNullsLast = 'id_DESC_NULLS_LAST',
-}
-
-export type AccountWhereInput = {
- AND?: InputMaybe>
- OR?: InputMaybe>
- contributions_every?: InputMaybe
- contributions_none?: InputMaybe
- contributions_some?: InputMaybe
- id_contains?: InputMaybe
- id_containsInsensitive?: InputMaybe
- id_endsWith?: InputMaybe
- id_eq?: InputMaybe
- id_gt?: InputMaybe
- id_gte?: InputMaybe
- id_in?: InputMaybe>
- id_isNull?: InputMaybe
- id_lt?: InputMaybe
- id_lte?: InputMaybe
- id_not_contains?: InputMaybe
- id_not_containsInsensitive?: InputMaybe
- id_not_endsWith?: InputMaybe
- id_not_eq?: InputMaybe
- id_not_in?: InputMaybe>
- id_not_startsWith?: InputMaybe
- id_startsWith?: InputMaybe
-}
-
-export type AccountsConnection = {
- __typename?: 'AccountsConnection'
- edges: Array
- pageInfo: PageInfo
- totalCount: Scalars['Int']['output']
-}
-
-export type Contribution = {
- __typename?: 'Contribution'
- account: Account
- amount: Scalars['BigInt']['output']
- blockNumber: Scalars['Int']['output']
- crowdloan: Crowdloan
- id: Scalars['String']['output']
- returned: Scalars['Boolean']['output']
- timestamp: Scalars['DateTime']['output']
-}
-
-export type ContributionEdge = {
- __typename?: 'ContributionEdge'
- cursor: Scalars['String']['output']
- node: Contribution
-}
-
-export enum ContributionOrderByInput {
- AccountIdAsc = 'account_id_ASC',
- AccountIdAscNullsFirst = 'account_id_ASC_NULLS_FIRST',
- AccountIdDesc = 'account_id_DESC',
- AccountIdDescNullsLast = 'account_id_DESC_NULLS_LAST',
- AmountAsc = 'amount_ASC',
- AmountAscNullsFirst = 'amount_ASC_NULLS_FIRST',
- AmountDesc = 'amount_DESC',
- AmountDescNullsLast = 'amount_DESC_NULLS_LAST',
- BlockNumberAsc = 'blockNumber_ASC',
- BlockNumberAscNullsFirst = 'blockNumber_ASC_NULLS_FIRST',
- BlockNumberDesc = 'blockNumber_DESC',
- BlockNumberDescNullsLast = 'blockNumber_DESC_NULLS_LAST',
- CrowdloanCapAsc = 'crowdloan_cap_ASC',
- CrowdloanCapAscNullsFirst = 'crowdloan_cap_ASC_NULLS_FIRST',
- CrowdloanCapDesc = 'crowdloan_cap_DESC',
- CrowdloanCapDescNullsLast = 'crowdloan_cap_DESC_NULLS_LAST',
- CrowdloanCreatedBlockNumberAsc = 'crowdloan_createdBlockNumber_ASC',
- CrowdloanCreatedBlockNumberAscNullsFirst = 'crowdloan_createdBlockNumber_ASC_NULLS_FIRST',
- CrowdloanCreatedBlockNumberDesc = 'crowdloan_createdBlockNumber_DESC',
- CrowdloanCreatedBlockNumberDescNullsLast = 'crowdloan_createdBlockNumber_DESC_NULLS_LAST',
- CrowdloanCreatedTimestampAsc = 'crowdloan_createdTimestamp_ASC',
- CrowdloanCreatedTimestampAscNullsFirst = 'crowdloan_createdTimestamp_ASC_NULLS_FIRST',
- CrowdloanCreatedTimestampDesc = 'crowdloan_createdTimestamp_DESC',
- CrowdloanCreatedTimestampDescNullsLast = 'crowdloan_createdTimestamp_DESC_NULLS_LAST',
- CrowdloanDepositorAsc = 'crowdloan_depositor_ASC',
- CrowdloanDepositorAscNullsFirst = 'crowdloan_depositor_ASC_NULLS_FIRST',
- CrowdloanDepositorDesc = 'crowdloan_depositor_DESC',
- CrowdloanDepositorDescNullsLast = 'crowdloan_depositor_DESC_NULLS_LAST',
- CrowdloanDissolvedBlockNumberAsc = 'crowdloan_dissolvedBlockNumber_ASC',
- CrowdloanDissolvedBlockNumberAscNullsFirst = 'crowdloan_dissolvedBlockNumber_ASC_NULLS_FIRST',
- CrowdloanDissolvedBlockNumberDesc = 'crowdloan_dissolvedBlockNumber_DESC',
- CrowdloanDissolvedBlockNumberDescNullsLast = 'crowdloan_dissolvedBlockNumber_DESC_NULLS_LAST',
- CrowdloanDissolvedTimestampAsc = 'crowdloan_dissolvedTimestamp_ASC',
- CrowdloanDissolvedTimestampAscNullsFirst = 'crowdloan_dissolvedTimestamp_ASC_NULLS_FIRST',
- CrowdloanDissolvedTimestampDesc = 'crowdloan_dissolvedTimestamp_DESC',
- CrowdloanDissolvedTimestampDescNullsLast = 'crowdloan_dissolvedTimestamp_DESC_NULLS_LAST',
- CrowdloanDissolvedAsc = 'crowdloan_dissolved_ASC',
- CrowdloanDissolvedAscNullsFirst = 'crowdloan_dissolved_ASC_NULLS_FIRST',
- CrowdloanDissolvedDesc = 'crowdloan_dissolved_DESC',
- CrowdloanDissolvedDescNullsLast = 'crowdloan_dissolved_DESC_NULLS_LAST',
- CrowdloanEndAsc = 'crowdloan_end_ASC',
- CrowdloanEndAscNullsFirst = 'crowdloan_end_ASC_NULLS_FIRST',
- CrowdloanEndDesc = 'crowdloan_end_DESC',
- CrowdloanEndDescNullsLast = 'crowdloan_end_DESC_NULLS_LAST',
- CrowdloanFirstPeriodAsc = 'crowdloan_firstPeriod_ASC',
- CrowdloanFirstPeriodAscNullsFirst = 'crowdloan_firstPeriod_ASC_NULLS_FIRST',
- CrowdloanFirstPeriodDesc = 'crowdloan_firstPeriod_DESC',
- CrowdloanFirstPeriodDescNullsLast = 'crowdloan_firstPeriod_DESC_NULLS_LAST',
- CrowdloanFundAccountAsc = 'crowdloan_fundAccount_ASC',
- CrowdloanFundAccountAscNullsFirst = 'crowdloan_fundAccount_ASC_NULLS_FIRST',
- CrowdloanFundAccountDesc = 'crowdloan_fundAccount_DESC',
- CrowdloanFundAccountDescNullsLast = 'crowdloan_fundAccount_DESC_NULLS_LAST',
- CrowdloanFundIndexAsc = 'crowdloan_fundIndex_ASC',
- CrowdloanFundIndexAscNullsFirst = 'crowdloan_fundIndex_ASC_NULLS_FIRST',
- CrowdloanFundIndexDesc = 'crowdloan_fundIndex_DESC',
- CrowdloanFundIndexDescNullsLast = 'crowdloan_fundIndex_DESC_NULLS_LAST',
- CrowdloanIdAsc = 'crowdloan_id_ASC',
- CrowdloanIdAscNullsFirst = 'crowdloan_id_ASC_NULLS_FIRST',
- CrowdloanIdDesc = 'crowdloan_id_DESC',
- CrowdloanIdDescNullsLast = 'crowdloan_id_DESC_NULLS_LAST',
- CrowdloanLastBlockAsc = 'crowdloan_lastBlock_ASC',
- CrowdloanLastBlockAscNullsFirst = 'crowdloan_lastBlock_ASC_NULLS_FIRST',
- CrowdloanLastBlockDesc = 'crowdloan_lastBlock_DESC',
- CrowdloanLastBlockDescNullsLast = 'crowdloan_lastBlock_DESC_NULLS_LAST',
- CrowdloanLastPeriodAsc = 'crowdloan_lastPeriod_ASC',
- CrowdloanLastPeriodAscNullsFirst = 'crowdloan_lastPeriod_ASC_NULLS_FIRST',
- CrowdloanLastPeriodDesc = 'crowdloan_lastPeriod_DESC',
- CrowdloanLastPeriodDescNullsLast = 'crowdloan_lastPeriod_DESC_NULLS_LAST',
- CrowdloanParaIdAsc = 'crowdloan_paraId_ASC',
- CrowdloanParaIdAscNullsFirst = 'crowdloan_paraId_ASC_NULLS_FIRST',
- CrowdloanParaIdDesc = 'crowdloan_paraId_DESC',
- CrowdloanParaIdDescNullsLast = 'crowdloan_paraId_DESC_NULLS_LAST',
- CrowdloanRefundedAsc = 'crowdloan_refunded_ASC',
- CrowdloanRefundedAscNullsFirst = 'crowdloan_refunded_ASC_NULLS_FIRST',
- CrowdloanRefundedDesc = 'crowdloan_refunded_DESC',
- CrowdloanRefundedDescNullsLast = 'crowdloan_refunded_DESC_NULLS_LAST',
- IdAsc = 'id_ASC',
- IdAscNullsFirst = 'id_ASC_NULLS_FIRST',
- IdDesc = 'id_DESC',
- IdDescNullsLast = 'id_DESC_NULLS_LAST',
- ReturnedAsc = 'returned_ASC',
- ReturnedAscNullsFirst = 'returned_ASC_NULLS_FIRST',
- ReturnedDesc = 'returned_DESC',
- ReturnedDescNullsLast = 'returned_DESC_NULLS_LAST',
- TimestampAsc = 'timestamp_ASC',
- TimestampAscNullsFirst = 'timestamp_ASC_NULLS_FIRST',
- TimestampDesc = 'timestamp_DESC',
- TimestampDescNullsLast = 'timestamp_DESC_NULLS_LAST',
-}
-
-export type ContributionWhereInput = {
- AND?: InputMaybe>
- OR?: InputMaybe>
- account?: InputMaybe
- account_isNull?: InputMaybe
- amount_eq?: InputMaybe
- amount_gt?: InputMaybe
- amount_gte?: InputMaybe
- amount_in?: InputMaybe>
- amount_isNull?: InputMaybe
- amount_lt?: InputMaybe
- amount_lte?: InputMaybe
- amount_not_eq?: InputMaybe
- amount_not_in?: InputMaybe>
- blockNumber_eq?: InputMaybe
- blockNumber_gt?: InputMaybe
- blockNumber_gte?: InputMaybe
- blockNumber_in?: InputMaybe>
- blockNumber_isNull?: InputMaybe
- blockNumber_lt?: InputMaybe
- blockNumber_lte?: InputMaybe
- blockNumber_not_eq?: InputMaybe
- blockNumber_not_in?: InputMaybe>
- crowdloan?: InputMaybe
- crowdloan_isNull?: InputMaybe
- id_contains?: InputMaybe
- id_containsInsensitive?: InputMaybe
- id_endsWith?: InputMaybe
- id_eq?: InputMaybe
- id_gt?: InputMaybe
- id_gte?: InputMaybe
- id_in?: InputMaybe>
- id_isNull?: InputMaybe
- id_lt?: InputMaybe
- id_lte?: InputMaybe
- id_not_contains?: InputMaybe
- id_not_containsInsensitive?: InputMaybe
- id_not_endsWith?: InputMaybe
- id_not_eq?: InputMaybe
- id_not_in?: InputMaybe>
- id_not_startsWith?: InputMaybe
- id_startsWith?: InputMaybe
- returned_eq?: InputMaybe
- returned_isNull?: InputMaybe
- returned_not_eq?: InputMaybe
- timestamp_eq?: InputMaybe
- timestamp_gt?: InputMaybe
- timestamp_gte?: InputMaybe
- timestamp_in?: InputMaybe>
- timestamp_isNull?: InputMaybe
- timestamp_lt?: InputMaybe
- timestamp_lte?: InputMaybe
- timestamp_not_eq?: InputMaybe
- timestamp_not_in?: InputMaybe>
-}
-
-export type ContributionsConnection = {
- __typename?: 'ContributionsConnection'
- edges: Array
- pageInfo: PageInfo
- totalCount: Scalars['Int']['output']
-}
-
-export type Crowdloan = {
- __typename?: 'Crowdloan'
- cap?: Maybe
- contributions: Array
- createdBlockNumber: Scalars['Int']['output']
- createdTimestamp: Scalars['DateTime']['output']
- depositor?: Maybe
- dissolved: Scalars['Boolean']['output']
- dissolvedBlockNumber?: Maybe
- dissolvedTimestamp?: Maybe
- end?: Maybe
- firstPeriod?: Maybe
- fundAccount: Scalars['String']['output']
- fundIndex: Scalars['Int']['output']
- id: Scalars['String']['output']
- lastBlock?: Maybe
- lastPeriod?: Maybe
- paraId: Scalars['Int']['output']
- refunded: Scalars['Boolean']['output']
-}
-
-export type CrowdloanContributionsArgs = {
- limit?: InputMaybe
- offset?: InputMaybe
- orderBy?: InputMaybe>
- where?: InputMaybe
-}
-
-export type CrowdloanEdge = {
- __typename?: 'CrowdloanEdge'
- cursor: Scalars['String']['output']
- node: Crowdloan
-}
-
-export enum CrowdloanOrderByInput {
- CapAsc = 'cap_ASC',
- CapAscNullsFirst = 'cap_ASC_NULLS_FIRST',
- CapDesc = 'cap_DESC',
- CapDescNullsLast = 'cap_DESC_NULLS_LAST',
- CreatedBlockNumberAsc = 'createdBlockNumber_ASC',
- CreatedBlockNumberAscNullsFirst = 'createdBlockNumber_ASC_NULLS_FIRST',
- CreatedBlockNumberDesc = 'createdBlockNumber_DESC',
- CreatedBlockNumberDescNullsLast = 'createdBlockNumber_DESC_NULLS_LAST',
- CreatedTimestampAsc = 'createdTimestamp_ASC',
- CreatedTimestampAscNullsFirst = 'createdTimestamp_ASC_NULLS_FIRST',
- CreatedTimestampDesc = 'createdTimestamp_DESC',
- CreatedTimestampDescNullsLast = 'createdTimestamp_DESC_NULLS_LAST',
- DepositorAsc = 'depositor_ASC',
- DepositorAscNullsFirst = 'depositor_ASC_NULLS_FIRST',
- DepositorDesc = 'depositor_DESC',
- DepositorDescNullsLast = 'depositor_DESC_NULLS_LAST',
- DissolvedBlockNumberAsc = 'dissolvedBlockNumber_ASC',
- DissolvedBlockNumberAscNullsFirst = 'dissolvedBlockNumber_ASC_NULLS_FIRST',
- DissolvedBlockNumberDesc = 'dissolvedBlockNumber_DESC',
- DissolvedBlockNumberDescNullsLast = 'dissolvedBlockNumber_DESC_NULLS_LAST',
- DissolvedTimestampAsc = 'dissolvedTimestamp_ASC',
- DissolvedTimestampAscNullsFirst = 'dissolvedTimestamp_ASC_NULLS_FIRST',
- DissolvedTimestampDesc = 'dissolvedTimestamp_DESC',
- DissolvedTimestampDescNullsLast = 'dissolvedTimestamp_DESC_NULLS_LAST',
- DissolvedAsc = 'dissolved_ASC',
- DissolvedAscNullsFirst = 'dissolved_ASC_NULLS_FIRST',
- DissolvedDesc = 'dissolved_DESC',
- DissolvedDescNullsLast = 'dissolved_DESC_NULLS_LAST',
- EndAsc = 'end_ASC',
- EndAscNullsFirst = 'end_ASC_NULLS_FIRST',
- EndDesc = 'end_DESC',
- EndDescNullsLast = 'end_DESC_NULLS_LAST',
- FirstPeriodAsc = 'firstPeriod_ASC',
- FirstPeriodAscNullsFirst = 'firstPeriod_ASC_NULLS_FIRST',
- FirstPeriodDesc = 'firstPeriod_DESC',
- FirstPeriodDescNullsLast = 'firstPeriod_DESC_NULLS_LAST',
- FundAccountAsc = 'fundAccount_ASC',
- FundAccountAscNullsFirst = 'fundAccount_ASC_NULLS_FIRST',
- FundAccountDesc = 'fundAccount_DESC',
- FundAccountDescNullsLast = 'fundAccount_DESC_NULLS_LAST',
- FundIndexAsc = 'fundIndex_ASC',
- FundIndexAscNullsFirst = 'fundIndex_ASC_NULLS_FIRST',
- FundIndexDesc = 'fundIndex_DESC',
- FundIndexDescNullsLast = 'fundIndex_DESC_NULLS_LAST',
- IdAsc = 'id_ASC',
- IdAscNullsFirst = 'id_ASC_NULLS_FIRST',
- IdDesc = 'id_DESC',
- IdDescNullsLast = 'id_DESC_NULLS_LAST',
- LastBlockAsc = 'lastBlock_ASC',
- LastBlockAscNullsFirst = 'lastBlock_ASC_NULLS_FIRST',
- LastBlockDesc = 'lastBlock_DESC',
- LastBlockDescNullsLast = 'lastBlock_DESC_NULLS_LAST',
- LastPeriodAsc = 'lastPeriod_ASC',
- LastPeriodAscNullsFirst = 'lastPeriod_ASC_NULLS_FIRST',
- LastPeriodDesc = 'lastPeriod_DESC',
- LastPeriodDescNullsLast = 'lastPeriod_DESC_NULLS_LAST',
- ParaIdAsc = 'paraId_ASC',
- ParaIdAscNullsFirst = 'paraId_ASC_NULLS_FIRST',
- ParaIdDesc = 'paraId_DESC',
- ParaIdDescNullsLast = 'paraId_DESC_NULLS_LAST',
- RefundedAsc = 'refunded_ASC',
- RefundedAscNullsFirst = 'refunded_ASC_NULLS_FIRST',
- RefundedDesc = 'refunded_DESC',
- RefundedDescNullsLast = 'refunded_DESC_NULLS_LAST',
-}
-
-export type CrowdloanWhereInput = {
- AND?: InputMaybe>
- OR?: InputMaybe>
- cap_eq?: InputMaybe
- cap_gt?: InputMaybe
- cap_gte?: InputMaybe
- cap_in?: InputMaybe>
- cap_isNull?: InputMaybe
- cap_lt?: InputMaybe
- cap_lte?: InputMaybe
- cap_not_eq?: InputMaybe
- cap_not_in?: InputMaybe>
- contributions_every?: InputMaybe
- contributions_none?: InputMaybe
- contributions_some?: InputMaybe
- createdBlockNumber_eq?: InputMaybe
- createdBlockNumber_gt?: InputMaybe
- createdBlockNumber_gte?: InputMaybe
- createdBlockNumber_in?: InputMaybe>
- createdBlockNumber_isNull?: InputMaybe
- createdBlockNumber_lt?: InputMaybe
- createdBlockNumber_lte?: InputMaybe
- createdBlockNumber_not_eq?: InputMaybe
- createdBlockNumber_not_in?: InputMaybe>
- createdTimestamp_eq?: InputMaybe
- createdTimestamp_gt?: InputMaybe
- createdTimestamp_gte?: InputMaybe
- createdTimestamp_in?: InputMaybe>
- createdTimestamp_isNull?: InputMaybe
- createdTimestamp_lt?: InputMaybe
- createdTimestamp_lte?: InputMaybe
- createdTimestamp_not_eq?: InputMaybe
- createdTimestamp_not_in?: InputMaybe>
- depositor_contains?: InputMaybe
- depositor_containsInsensitive?: InputMaybe
- depositor_endsWith?: InputMaybe
- depositor_eq?: InputMaybe
- depositor_gt?: InputMaybe
- depositor_gte?: InputMaybe
- depositor_in?: InputMaybe>
- depositor_isNull?: InputMaybe
- depositor_lt?: InputMaybe
- depositor_lte?: InputMaybe
- depositor_not_contains?: InputMaybe
- depositor_not_containsInsensitive?: InputMaybe
- depositor_not_endsWith?: InputMaybe
- depositor_not_eq?: InputMaybe
- depositor_not_in?: InputMaybe>
- depositor_not_startsWith?: InputMaybe
- depositor_startsWith?: InputMaybe
- dissolvedBlockNumber_eq?: InputMaybe
- dissolvedBlockNumber_gt?: InputMaybe
- dissolvedBlockNumber_gte?: InputMaybe
- dissolvedBlockNumber_in?: InputMaybe>
- dissolvedBlockNumber_isNull?: InputMaybe
- dissolvedBlockNumber_lt?: InputMaybe
- dissolvedBlockNumber_lte?: InputMaybe
- dissolvedBlockNumber_not_eq?: InputMaybe
- dissolvedBlockNumber_not_in?: InputMaybe>
- dissolvedTimestamp_eq?: InputMaybe
- dissolvedTimestamp_gt?: InputMaybe
- dissolvedTimestamp_gte?: InputMaybe
- dissolvedTimestamp_in?: InputMaybe>
- dissolvedTimestamp_isNull?: InputMaybe
- dissolvedTimestamp_lt?: InputMaybe
- dissolvedTimestamp_lte?: InputMaybe
- dissolvedTimestamp_not_eq?: InputMaybe
- dissolvedTimestamp_not_in?: InputMaybe>
- dissolved_eq?: InputMaybe
- dissolved_isNull?: InputMaybe
- dissolved_not_eq?: InputMaybe
- end_eq?: InputMaybe
- end_gt?: InputMaybe
- end_gte?: InputMaybe
- end_in?: InputMaybe>
- end_isNull?: InputMaybe
- end_lt?: InputMaybe
- end_lte?: InputMaybe
- end_not_eq?: InputMaybe
- end_not_in?: InputMaybe>
- firstPeriod_eq?: InputMaybe
- firstPeriod_gt?: InputMaybe
- firstPeriod_gte?: InputMaybe
- firstPeriod_in?: InputMaybe>
- firstPeriod_isNull?: InputMaybe
- firstPeriod_lt?: InputMaybe
- firstPeriod_lte?: InputMaybe
- firstPeriod_not_eq?: InputMaybe
- firstPeriod_not_in?: InputMaybe>
- fundAccount_contains?: InputMaybe
- fundAccount_containsInsensitive?: InputMaybe