diff --git a/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList.js b/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList.js deleted file mode 100644 index daf0ab1f4..000000000 --- a/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList.js +++ /dev/null @@ -1,85 +0,0 @@ -// @ts-nocheck -import React, {memo} from "react"; -import {NavLink} from "react-router-dom"; -import classNames from "classnames/bind"; -import consts from "src/constants/consts"; -import {logoBrand} from "src/constants/logoBrand"; -import {formatOrai, formatNumber} from "src/helpers/helper"; -import {_} from "src/lib/scripts"; -import {Tooltip} from "@material-ui/core"; -import styles from "./AssetsIbcCardList.module.scss"; - -const TestCaseCardList = memo(({data = []}) => { - const cx = classNames.bind(styles); - - return ( -
- {data.map((item, index) => { - // const matchedLogoItem = logoBrand.find(logoBrandItem => item?.owner === logoBrandItem.operatorAddress); - // let ownerName; - // if (matchedLogoItem) { - // ownerName = matchedLogoItem?.name ?? "-"; - // } - - return ( -
- - - - - - - - - - - - - - - - -
-
Name
-
- {_.isNil(item?.channelId) ? ( -
-
- ) : ( - <> -
{item.symbol}
-
{item.channelId}
- - )} -
-
Price
- {_.isNil(item?.prices) ? ( -
-
- ) : ( -
- $ {item?.prices?.price} - {/* ORAI */} -
- )} -
-
Supply
- {_.isNil(item?.prices) ? ( -
-
- ) : ( -
{formatNumber(item?.prices?.supply)}
- )} -
-
Total Value
- {_.isNil(item?.prices) ? ( -
-
- ) : ( -
{formatNumber(item?.prices?.TotalValue)}
- )} -
-
- ); - })} -
- ); -}); - -export default TestCaseCardList; diff --git a/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList.module.scss b/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList.module.scss deleted file mode 100644 index 76a6e7dab..000000000 --- a/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList.module.scss +++ /dev/null @@ -1,92 +0,0 @@ -@import "src/styles/utils"; - -.test-case-card-list { - &-item { - padding: 15px; - margin-bottom: 15px; - background-color: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - - table { - width: 100%; - tr { - td:nth-child(1) { - text-align: left; - } - td:nth-child(2) { - text-align: right; - } - - &:nth-child(1), - &:nth-child(2), - &:nth-child(3), - &:nth-child(4) { - td { - padding-bottom: 15px; - } - } - } - } - - .item-title { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 150%; - white-space: nowrap; - } - - .item-text { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - word-break: break-all; - } - - .item-link { - color: var(--common-linkColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - word-break: break-all; - } - .item-symbol { - text-transform: uppercase; - } - } -} - -.price { - display: inline-flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - - &-value { - display: inline-block; - padding-right: 4px; - } - - &-denom { - color: var(--common-oraiDenomTextColor); - display: inline-block; - text-transform: uppercase; - } -} - -.skeleton { - display: inline-block; -} diff --git a/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardListSkeleton.js b/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardListSkeleton.js deleted file mode 100644 index 4fa067ca0..000000000 --- a/src/components/Ibc/AssetsIbcCardList/AssetsIbcCardListSkeleton.js +++ /dev/null @@ -1,57 +0,0 @@ -import React, {memo} from "react"; -import Skeleton from "@material-ui/lab/Skeleton"; -import classNames from "classnames/bind"; -import styles from "./AssetsIbcCardList.module.scss"; - -const TestCaseCardListSkeleton = memo(({rows = 10}) => { - const cx = classNames.bind(styles); - - let testCaseCardListItems = []; - for (let i = 1; i <= rows; i++) { - testCaseCardListItems.push( -
- - - - - - - - - - - - - - - -
-
Name
-
-
- -
-
-
Price
-
- -
-
-
Supply
-
- -
-
-
Total Value
-
- -
-
-
- ); - } - - return
{testCaseCardListItems}
; -}); - -export default TestCaseCardListSkeleton; diff --git a/src/components/Ibc/AssetsIbcCardList/index.js b/src/components/Ibc/AssetsIbcCardList/index.js deleted file mode 100644 index b86516c10..000000000 --- a/src/components/Ibc/AssetsIbcCardList/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./AssetsIbcCardList"; diff --git a/src/components/Ibc/AssetsIbcTable/AssetsIbcSkeletonTable.js b/src/components/Ibc/AssetsIbcTable/AssetsIbcSkeletonTable.js deleted file mode 100644 index 73cf274d2..000000000 --- a/src/components/Ibc/AssetsIbcTable/AssetsIbcSkeletonTable.js +++ /dev/null @@ -1,25 +0,0 @@ -// @ts-nocheck -/* eslint-disable react-hooks/exhaustive-deps */ -import React from "react"; -import classNames from "classnames/bind"; -import styles from "./AssetsIbcSkeletonTable.module.scss"; - -const cx = classNames.bind(styles); - -export const getHeaderRow = () => { - const nameHeaderCell =
Name
; - const priceHeaderCell =
Price
; - const supplyHeaderCell =
Supply
; - const totalValueHeaderCell =
Total Value
; - const headerCells = [nameHeaderCell, priceHeaderCell, supplyHeaderCell, totalValueHeaderCell]; - const headerCellStyles = [ - {minWidth: "250px"}, // Name - {minWidth: "100px"}, // Price - {minWidth: "100px"}, // Supply - {minWidth: "100px"}, // Total Value - ]; - return { - headerCells, - headerCellStyles, - }; -}; diff --git a/src/components/Ibc/AssetsIbcTable/AssetsIbcSkeletonTable.module.scss b/src/components/Ibc/AssetsIbcTable/AssetsIbcSkeletonTable.module.scss deleted file mode 100644 index 16f7eefdb..000000000 --- a/src/components/Ibc/AssetsIbcTable/AssetsIbcSkeletonTable.module.scss +++ /dev/null @@ -1,63 +0,0 @@ -@import "src/styles/utils"; - -.align-left { - text-align: left; -} - -.align-right { - text-align: right; -} - -.align-center { - text-align: center; -} - -.header-cell { - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: bold; - font-size: 14px; - line-height: 150%; - color: var(--common-headerTextColor); -} - -.name-data-cell, -.price-data-cell, -.total-value-data-cell { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; -} - -.supply-data-cell { - .supply { - display: inline-flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - - &-value { - display: inline-block; - padding-right: 4px; - } - - &-denom { - color: var(--common-oraiDenomTextColor); - display: inline-block; - text-transform: uppercase; - } - } -} - -.skeleton { - display: inline-block; -} diff --git a/src/components/Ibc/AssetsIbcTable/AssetsIbcTable.js b/src/components/Ibc/AssetsIbcTable/AssetsIbcTable.js deleted file mode 100644 index 115020315..000000000 --- a/src/components/Ibc/AssetsIbcTable/AssetsIbcTable.js +++ /dev/null @@ -1,89 +0,0 @@ -// @ts-nocheck -/* eslint-disable react-hooks/exhaustive-deps */ -import React, {memo, useMemo} from "react"; -import {NavLink} from "react-router-dom"; -import classNames from "classnames/bind"; -import consts from "src/constants/consts"; -import {logoBrand} from "src/constants/logoBrand"; -import {tableThemes} from "src/constants/tableThemes"; -import {formatOrai, formatNumber} from "src/helpers/helper"; -import {_} from "src/lib/scripts"; -import ThemedTable from "src/components/common/ThemedTable"; -import {Tooltip} from "@material-ui/core"; -import styles from "./AssetsIbcTable.module.scss"; - -const cx = classNames.bind(styles); - -export const getHeaderRow = () => { - const nameHeaderCell =
Name
; - const priceHeaderCell =
Price
; - const supplyHeaderCell =
Supply
; - const totalValueHeaderCell =
Total Value
; - const headerCells = [nameHeaderCell, priceHeaderCell, supplyHeaderCell, totalValueHeaderCell]; - const headerCellStyles = [ - {minWidth: "250px"}, // Name - {minWidth: "100px"}, // Price - {minWidth: "100px"}, // Supply - {minWidth: "100px"}, // Total Value - ]; - return { - headerCells, - headerCellStyles, - }; -}; - -const TestCaseTable = memo(({data = []}) => { - const getDataRows = data => { - if (!Array.isArray(data)) { - return []; - } - - return data.map(item => { - const logoURL = item?.images?.thumb ? item?.images?.thumb : false; - const nameDataCell = _.isNil(item?.channelId) ? ( -
-
- ) : ( -
- {logoURL && /} - {!logoURL &&
{item.denom.substring(0, 3).toUpperCase()}
} -
-
{item?.symbol || "UNKNOWN"}
-
{item?.channelId}
-
-
- ); - - const priceHashDataCell = _.isNil(item?.prices) ? ( -
-
- ) : ( -
$ {item?.prices?.price}
- ); - - const supplyDataCell = _.isNil(item?.prices) ? ( -
-
- ) : ( -
-
- {formatNumber(item?.prices?.supply)} - {/* ORAI */} -
-
- ); - - const totalValueDataCell = _.isNil(item?.prices) ? ( -
-
- ) : ( -
$ {formatNumber(item?.prices?.TotalValue)}
- ); - - return [nameDataCell, priceHashDataCell, supplyDataCell, totalValueDataCell]; - }); - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(data), [data, getDataRows]); - - return ; -}); - -export default TestCaseTable; diff --git a/src/components/Ibc/AssetsIbcTable/AssetsIbcTable.module.scss b/src/components/Ibc/AssetsIbcTable/AssetsIbcTable.module.scss deleted file mode 100644 index f2f913b31..000000000 --- a/src/components/Ibc/AssetsIbcTable/AssetsIbcTable.module.scss +++ /dev/null @@ -1,92 +0,0 @@ -@import "src/styles/utils"; - -.align-left { - text-align: left; -} - -.align-right { - text-align: right; -} - -.align-center { - text-align: center; -} - -.header-cell { - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: bold; - font-size: 14px; - line-height: 150%; - color: var(--common-headerTextColor); -} - -.name-data-cell, -.price-data-cell, -.total-value-data-cell { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - word-break: break-all; -} - -.supply-data-cell { - .supply { - display: inline-flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - - &-value { - display: inline-block; - padding-right: 4px; - } - - &-denom { - color: var(--common-oraiDenomTextColor); - display: inline-block; - text-transform: uppercase; - } - } -} - -.skeleton { - display: inline-block; -} - -.logo-brand-custom { - display: flex; - align-items: center; -} - -.name-data { - padding-left: 13px; -} -.symbol { - text-transform: uppercase; -} - -.channel { - color: #89909b; -} - -.logo-custom { - border-radius: 50%; - border: 1px solid var(--validators-logo-border); - padding: 5px; - width: 32px; - height: 32px; - display: flex; - align-items: center; - justify-content: center; - opacity: 0.5; -} \ No newline at end of file diff --git a/src/components/Ibc/AssetsIbcTable/AssetsIbcTableSkeleton.js b/src/components/Ibc/AssetsIbcTable/AssetsIbcTableSkeleton.js deleted file mode 100644 index bff5ca6a0..000000000 --- a/src/components/Ibc/AssetsIbcTable/AssetsIbcTableSkeleton.js +++ /dev/null @@ -1,56 +0,0 @@ -import React, {memo, useMemo} from "react"; -import PropTypes from "prop-types"; -import classNames from "classnames/bind"; -import Skeleton from "@material-ui/lab/Skeleton"; -import {tableThemes} from "src/constants/tableThemes"; -import ThemedTable from "src/components/common/ThemedTable"; -import {getHeaderRow} from "./AssetsIbcSkeletonTable"; -import styles from "./AssetsIbcTable.module.scss"; - -const AssetsIbcTableSkeleton = memo(({rows}) => { - const cx = classNames.bind(styles); - const getDataRows = rows => { - let dataRows = []; - for (let i = 1; i <= rows; i++) { - const nameDataCell = ( -
- -
- ); - - const priceHashDataCell = ( -
- -
- ); - - const supplyDataCell = ( -
- -
- ); - - const totalValueDataCell = ( -
- -
- ); - dataRows.push([nameDataCell, priceHashDataCell, supplyDataCell, totalValueDataCell]); - } - return dataRows; - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(rows), [rows]); - - return ; -}); - -AssetsIbcTableSkeleton.propTypes = { - rows: PropTypes.number, -}; -AssetsIbcTableSkeleton.defaultProps = { - rows: 10, -}; - -export default AssetsIbcTableSkeleton; diff --git a/src/components/Ibc/AssetsIbcTable/index.js b/src/components/Ibc/AssetsIbcTable/index.js deleted file mode 100644 index 1e944a6ed..000000000 --- a/src/components/Ibc/AssetsIbcTable/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./AssetsIbcTable"; diff --git a/src/components/Ibc/DelegationCard/DelegationCard.js b/src/components/Ibc/DelegationCard/DelegationCard.js deleted file mode 100644 index 38acc9788..000000000 --- a/src/components/Ibc/DelegationCard/DelegationCard.js +++ /dev/null @@ -1,69 +0,0 @@ -import React, {memo, useState, useRef} from "react"; -import {useGet} from "restful-react"; -import classNames from "classnames/bind"; -import {useTheme} from "@material-ui/core/styles"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -import consts from "src/constants/consts"; -import DelegationTable from "src/components/Account/DelegationTable"; -import DelegationTableSkeleton from "src/components/Account/DelegationTable/DelegationTableSkeleton"; -import DelegationCardList from "src/components/Account/DelegationCardList/DelegationCardList"; -import DelegationCardListSkeleton from "src/components/Account/DelegationCardList/DelegationCardListSkeleton"; -import Pagination from "src/components/common/Pagination"; -import NoResult from "src/components/common/NoResult"; -import styles from "./DelegationCard.module.scss"; - -const cx = classNames.bind(styles); - -const DelegationCard = memo(({account = ""}) => { - const theme = useTheme(); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const [pageId, setPageId] = useState(1); - const totalPagesRef = useRef(null); - - const onPageChange = page => { - setPageId(page); - }; - - const path = `${consts.API.DELEGATIONS}/${account}`; - const {data, loading, error} = useGet({ - path: path, - }); - - let tableSection; - let paginationSection; - - if (loading) { - tableSection = isLargeScreen ? : ; - } else { - if (error) { - totalPagesRef.current = null; - tableSection = ; - } else { - if (!isNaN(data?.page?.total_page)) { - totalPagesRef.current = data.page.total_page; - } else { - totalPagesRef.current = null; - } - - if (Array.isArray(data?.data) && data.data.length > 0) { - tableSection = isLargeScreen ? : ; - } else { - tableSection = ; - } - } - } - - paginationSection = totalPagesRef.current ? onPageChange(page)} /> : <>; - - return ( -
-
Delegations
-
- {tableSection} - {paginationSection} -
-
- ); -}); - -export default DelegationCard; diff --git a/src/components/Ibc/DelegationCard/DelegationCard.module.scss b/src/components/Ibc/DelegationCard/DelegationCard.module.scss deleted file mode 100644 index 0be7e03dc..000000000 --- a/src/components/Ibc/DelegationCard/DelegationCard.module.scss +++ /dev/null @@ -1,37 +0,0 @@ -@import "src/styles/utils"; - -.delegation-card { - padding: 0; - background: transparent; - box-shadow: none; - height: 100%; - - @media screen and (min-width: 1280px) { - padding: 20px; - background: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - } - - &-header { - margin-bottom: 20px; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - letter-spacing: 0.4px; - } - - &-body { - position: relative; - - .no-result-wrapper { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } -} diff --git a/src/components/Ibc/DelegationCard/index.js b/src/components/Ibc/DelegationCard/index.js deleted file mode 100644 index 143f44194..000000000 --- a/src/components/Ibc/DelegationCard/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./DelegationCard"; diff --git a/src/components/Ibc/DelegationCardList/DelegationCardList.js b/src/components/Ibc/DelegationCardList/DelegationCardList.js deleted file mode 100644 index f692ceb68..000000000 --- a/src/components/Ibc/DelegationCardList/DelegationCardList.js +++ /dev/null @@ -1,143 +0,0 @@ -// @ts-nocheck -import React, {memo} from "react"; -import {NavLink} from "react-router-dom"; -import classNames from "classnames/bind"; -import consts from "src/constants/consts"; -import {formatOrai, parseIbc, fromNowMoment} from "src/helpers/helper"; -import {_, reduceString} from "src/lib/scripts"; -import CheckIcon from "src/icons/CheckIcon"; -import TimesIcon from "src/icons/TimesIcon"; -import RedoIcon from "src/icons/RedoIcon"; -import styles from "./DelegationCardList.module.scss"; - -const cx = classNames.bind(styles); - -const DelegationCardList = memo(({data = []}) => { - return ( -
- {data.map((item, index) => { - let resultDataCellContent; - if (!item?.transaction?.code) { - resultDataCellContent = ( -
- - Success -
- ); - } else if (item?.transaction?.code) { - resultDataCellContent = ( -
- - Failure -
- ); - } else if (item.transaction?.code === "pending") { - resultDataCellContent = ( -
- - Pending -
- ); - } - return ( -
- - - - - - - - - - - - - - - - - - - -
-
Tx Hash
-
- {_.isNil(item?.transaction) ? ( -
-
- ) : ( - - {reduceString(item.transaction?.tx_hash, 6, 6)} - - )} -
-
Type
- {_.isNil(item?.tx_type) ? ( -
-
- ) : ( -
-
- {item.tx_type} -
-
- )} -
-
Result
- {_.isNil(item?.tx_type) ? ( -
-
- ) : ( -
{resultDataCellContent}
- )} -
-
Amount
- {_.isNil(item?.amount) || _.isNil(item?.denom) ? ( -
-
- ) : ( -
- {formatOrai(item.amount)} - {parseIbc(item.denom)} -
- )} -
-
Fee
- {_.isNil(item?.transaction) || _.isNil(item?.transaction?.gas_wanted) ? ( -
-
- ) : ( -
-
- {formatOrai(item.transaction?.gas_wanted)} - {JSON.parse(item?.transaction?.fee)?.amount?.[0]?.denom} -
-
- )} -
-
Height
- {_.isNil(item?.transaction) || _.isNil(item?.transaction?.height) ? ( -
-
- ) : ( -
-
- {item?.transaction?.height} -
-
- )} -
-
Time
- {_.isNil(item?.created_at) ? ( -
-
- ) : ( -
-
- {fromNowMoment(item.created_at)} -
-
- )} -
-
- ); - })} -
- ); -}); - -export default DelegationCardList; diff --git a/src/components/Ibc/DelegationCardList/DelegationCardList.module.scss b/src/components/Ibc/DelegationCardList/DelegationCardList.module.scss deleted file mode 100644 index 5c8d4f45f..000000000 --- a/src/components/Ibc/DelegationCardList/DelegationCardList.module.scss +++ /dev/null @@ -1,111 +0,0 @@ -@import "src/styles/utils"; - -.delegation-card-list { - &-item { - padding: 15px; - margin-bottom: 15px; - background-color: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - - table { - width: 100%; - tr { - td:nth-child(1) { - text-align: left; - width: 50%; - } - td:nth-child(2) { - text-align: right; - width: 50%; - } - - &:nth-child(1) { - td { - padding-bottom: 15px; - } - } - } - } - - .item-title { - color: var(--common-oraiDenomTextColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 150%; - } - - .item-text { - color: var(--common-oraiDenomTextColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - - .item-link { - color: var(--common-oraiDenomTextColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - - .amount, - .reward { - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - - &-value { - display: inline-block; - margin-right: 4px; - color:var(--common-oraiDenomTextColor); - } - - &-denom { - display: inline-block; - color: var(--common-oraiDenomTextColor); - text-transform: uppercase; - } - } - } -} - - -.result-data-cell { - .result { - &-icon { - margin-right: 9px; - width: 16px; - height: auto; - - &-success { - color: var(--common-resultIconSuccessColor); - } - - &-failed { - color: var(--common-resultIconFailureColor); - } - - &-pending { - color: var(--common-resultIconPendingColor); - } - } - - &-text { - color: var(--common-oraiDenomTextColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - } - } -} \ No newline at end of file diff --git a/src/components/Ibc/DelegationCardList/DelegationCardListSkeleton.js b/src/components/Ibc/DelegationCardList/DelegationCardListSkeleton.js deleted file mode 100644 index f3ad8645f..000000000 --- a/src/components/Ibc/DelegationCardList/DelegationCardListSkeleton.js +++ /dev/null @@ -1,67 +0,0 @@ -import React, {memo} from "react"; -import Skeleton from "@material-ui/lab/Skeleton"; -import classNames from "classnames/bind"; -import styles from "./DelegationCardList.module.scss"; - -const DelegationCardListSkeleton = memo(({rows = 5}) => { - const cx = classNames.bind(styles); - - let delegationCardListItems = []; - for (let i = 1; i <= rows; i++) { - delegationCardListItems.push( -
- - - - - - - - - - - - - - - - - - - - - - -
-
Tx Hash
-
-
- -
-
-
Type
- -
-
Result
- -
-
Amount
- -
-
Fee
- -
-
Height
- -
-
Time
- -
-
- ); - } - - return
{delegationCardListItems}
; -}); - -export default DelegationCardListSkeleton; diff --git a/src/components/Ibc/DelegationCardList/index.js b/src/components/Ibc/DelegationCardList/index.js deleted file mode 100644 index 41abb0f53..000000000 --- a/src/components/Ibc/DelegationCardList/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./TransactionCardList"; diff --git a/src/components/Ibc/DelegationTable/DelegationTable.js b/src/components/Ibc/DelegationTable/DelegationTable.js deleted file mode 100644 index 4735af8d8..000000000 --- a/src/components/Ibc/DelegationTable/DelegationTable.js +++ /dev/null @@ -1,146 +0,0 @@ -import React, {memo, useMemo} from "react"; -import {NavLink} from "react-router-dom"; -import classNames from "classnames/bind"; -import {formatOrai, getDecimals, parseIbc} from "src/helpers/helper"; -import {_, reduceString} from "src/lib/scripts"; -import {tableThemes} from "src/constants/tableThemes"; -import ThemedTable from "src/components/common/ThemedTable"; -import CheckIcon from "src/icons/CheckIcon"; -import TimesIcon from "src/icons/TimesIcon"; -import RedoIcon from "src/icons/RedoIcon"; -import moment from "moment"; -import styles from "./DelegationTable.module.scss"; - -const cx = classNames.bind(styles); - -export const getHeaderRow = () => { - const txHashHeaderCell =
Tx Hash
; - const typeHeaderCell =
Type
; - const resultHeaderCell =
Result
; - const amountHeaderCell =
Amount
; - const feeHeaderCell =
Fee
; - const heightHeaderCell =
Height
; - const timeHeaderCell =
Time
; - const headerCells = [txHashHeaderCell, typeHeaderCell, resultHeaderCell, amountHeaderCell, feeHeaderCell, heightHeaderCell, timeHeaderCell]; - const headerCellStyles = [ - {width: "15%", minWidth: "100px"}, // Tx Hash - {width: "20%", minWidth: "200px"}, // Type - {width: "15%", minWidth: "130px"}, // Result - {width: "15%", minWidth: "130px"}, // Amount - {width: "13%", minWidth: "150px"}, // Fee - {width: "10%", minWidth: "80px"}, // Height - {width: "12%", minWidth: "80px"}, // Time - ]; - return { - headerCells, - headerCellStyles, - }; -}; - -const DelegationTable = memo(({data = []}) => { - const getDataRows = data => { - if (!Array.isArray(data)) { - return []; - } - - return data.map(item => { - let resultDataCellContent; - if (!item?.transaction?.code) { - resultDataCellContent = ( -
- - Success -
- ); - } else if (item?.transaction?.code) { - resultDataCellContent = ( -
- - Failure -
- ); - } else if (item.transaction?.code === "pending") { - resultDataCellContent = ( -
- - Pending -
- ); - } - - const txHashDataCell = - _.isNil(item?.transaction) && _.isNil(item?.transaction?.tx_hash) ? ( -
-
- ) : ( -
- - {reduceString(item?.transaction?.tx_hash, 6, 6)} - -
- ); - const typeDataCell = _.isNil(item?.tx_type) ? ( -
-
- ) : ( -
-
- {item.tx_type} -
-
- ); - const resultDataCell = _.isNil(item?.transaction?.code) ? ( -
-
- ) : ( -
{resultDataCellContent}
- ); - - const amountDataCell = _.isNil(item?.amount) ? ( -
-
- ) : ( -
-
- {formatOrai(item.amount, Math.pow(10, getDecimals(item.denom)))} - {parseIbc(item.denom)} -
-
- ); - const feeDataCell = - _.isNil(item?.transaction) || _.isNil(item?.transaction?.gas_wanted) ? ( -
-
- ) : ( -
-
- {(JSON.parse(item?.transaction?.fee)?.amount?.[0]?.amount / Math.pow(10, 6)).toFixed(6) || "0.000000"} - {JSON.parse(item?.transaction?.fee)?.amount?.[0]?.denom} -
-
- ); - const heightDataCell = - _.isNil(item?.transaction) || _.isNil(item?.transaction?.height) ? ( -
-
- ) : ( -
-
- {item?.transaction?.height} -
-
- ); - const timeDataCell = _.isNil(item?.created_at) ? ( -
-
- ) : ( -
-
- {moment(item.created_at).fromNow()} -
-
- ); - return [txHashDataCell, typeDataCell, resultDataCell, amountDataCell, feeDataCell, heightDataCell, timeDataCell]; - }); - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(data), [data]); - - return ; -}); - -export default DelegationTable; diff --git a/src/components/Ibc/DelegationTable/DelegationTable.module.scss b/src/components/Ibc/DelegationTable/DelegationTable.module.scss deleted file mode 100644 index c4be5e7c5..000000000 --- a/src/components/Ibc/DelegationTable/DelegationTable.module.scss +++ /dev/null @@ -1,111 +0,0 @@ -@import "src/styles/utils"; - -.align-left { - text-align: left; -} - -.align-right { - text-align: right; -} - -.header-cell { - color: var(--common-linkColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: bold; - font-size: 14px; - line-height: 150%; -} -.height-data-cell, -.type-data-cell { - color: var(--common-linkColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; -} - -.type { - &-text { - padding: 6px 10px; - margin-right: 5px; - border: 1px solid var(--common-transactions-transactionTypeLabelColor); - background-color: var(--common-transactions-transactionTypeBackgroundColor); - color: var(--common-transactions-transactionTypeTextColor); - box-sizing: border-box; - border-radius: 4px; - font-style: normal; - font-weight: 400; - font-size: 12px; - font-family: "IBM Plex Sans"; - line-height: 150%; - } -} - -.amount-data-cell { - .amount { - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - - &-value { - display: inline-block; - margin-right: 4px; - color: var(--common-textColor); - } - - &-denom { - display: inline-block; - color: var(--common-oraiDenomTextColor); - text-transform: uppercase; - } - } -} - -.link { - color: var(--common-linkColor); - font-family: IBM Plex Sans; - font-style: normal; - font-weight: 400; - font-size: 14px; - line-height: 150%; -} - -.result-data-cell { - .result { - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - - &-icon { - margin-right: 9px; - width: 16px; - height: auto; - - &-success { - color: var(--common-resultIconSuccessColor); - } - - &-failed { - color: var(--common-resultIconFailureColor); - } - - &-pending { - color: var(--common-resultIconPendingColor); - } - } - - &-text { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - } - } -} \ No newline at end of file diff --git a/src/components/Ibc/DelegationTable/DelegationTableSkeleton.js b/src/components/Ibc/DelegationTable/DelegationTableSkeleton.js deleted file mode 100644 index 1b80fe234..000000000 --- a/src/components/Ibc/DelegationTable/DelegationTableSkeleton.js +++ /dev/null @@ -1,61 +0,0 @@ -import React, {memo, useMemo} from "react"; -import Skeleton from "@material-ui/lab/Skeleton"; -import classNames from "classnames/bind"; -import {tableThemes} from "src/constants/tableThemes"; -import ThemedTable from "src/components/common/ThemedTable"; -import {getHeaderRow} from "src/components/Ibc/DelegationTable/DelegationTable"; -import styles from "./DelegationTable.module.scss"; - -const DelegationTableSkeleton = memo(({rows = 5}) => { - const cx = classNames.bind(styles); - const getDataRows = rows => { - let dataRows = []; - for (let i = 1; i <= rows; i++) { - const txHashDataCell = ( -
- -
- ); - const typeDataCell = ( -
- -
- ); - const resultDataCell = ( -
- -
- ); - const amountDataCell = ( -
- -
- ); - const feeDataCell = ( -
- -
- ); - const heightDataCell = ( -
- -
- ); - const timeDataCell = ( -
- -
- ); - - dataRows.push([txHashDataCell, typeDataCell, resultDataCell, amountDataCell, feeDataCell, heightDataCell, timeDataCell]); - } - return dataRows; - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(rows), [rows]); - - return ; -}); - -export default DelegationTableSkeleton; diff --git a/src/components/Ibc/DelegationTable/index.js b/src/components/Ibc/DelegationTable/index.js deleted file mode 100644 index d76bec85e..000000000 --- a/src/components/Ibc/DelegationTable/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./DelegationTable"; diff --git a/src/components/Ibc/FilterSection/FilterSection.js b/src/components/Ibc/FilterSection/FilterSection.js deleted file mode 100644 index 1157f53eb..000000000 --- a/src/components/Ibc/FilterSection/FilterSection.js +++ /dev/null @@ -1,109 +0,0 @@ -import React, { useEffect, useRef } from "react"; -import PropTypes from "prop-types"; -import Grid from "@material-ui/core/Grid"; -import cn from "classnames/bind"; -import SearchInput from "src/components/common/SearchInput"; -import styles from "./FilterSection.module.scss"; -import DownAngleIcon from "src/icons/DownAngleIcon"; -import { assetsNetworks, assetsDropDown } from "src/constants/ibc"; -import _ from "lodash"; - -const cx = cn.bind(styles); - -const FilterSection = ({ keyword, setKeyword, assetSearch, setAssetSearch, onChange }) => { - const selectedPriceFeedNetworkRef = useRef(null); - const listPriceFeedNetworks = useRef(null); - - const showList = () => { - if (!_.isNil(listPriceFeedNetworks.current)) { - listPriceFeedNetworks.current.style.display = "block"; - } - }; - - const hideList = () => { - if (!_.isNil(listPriceFeedNetworks.current)) { - listPriceFeedNetworks.current.style.display = "none"; - } - }; - - const clickListener = event => { - if (event?.target?.hasAttribute("ibc-network")) { - hideList(); - setAssetSearch(assetsNetworks.findIndex(e => e === event?.target?.getAttribute("ibc-network"))); - return; - } - - if (selectedPriceFeedNetworkRef?.current?.contains?.(event?.target)) { - if (listPriceFeedNetworks?.current?.style?.display === "block") { - hideList(); - } else { - showList(); - } - return; - } - - if (!_.isNil(listPriceFeedNetworks.current) && !listPriceFeedNetworks?.current?.contains?.(event?.target)) { - hideList(); - } - }; - - useEffect(() => { - document.addEventListener("click", clickListener, true); - - return () => { - document.removeEventListener("click", clickListener); - }; - }, []); - - return ( - - -
- { - // const query = { - // search: e.target.value, - // }; - // setKeyword(e.target.value); - // // history.push({ - // // pathname: `${history.location.pathname}`, - // // search: queryString.stringify(query, { - // // encode: false, - // // }), - // // }); - // }} - onChange={onChange} - /> -
-
- -
-
- - -
-
- {Object.values(assetsDropDown).map((item, index) => ( -
- {item} -
- ))} -
-
-
-
- ); -}; - -FilterSection.propTypes = { - isGridView: PropTypes.bool, - keyword: PropTypes.string, - setIsGridView: PropTypes.func, - setKeyword: PropTypes.func, -}; -FilterSection.defaultProps = {}; - -export default FilterSection; diff --git a/src/components/Ibc/FilterSection/FilterSection.module.scss b/src/components/Ibc/FilterSection/FilterSection.module.scss deleted file mode 100644 index d7cc46a01..000000000 --- a/src/components/Ibc/FilterSection/FilterSection.module.scss +++ /dev/null @@ -1,100 +0,0 @@ -@import "src/styles/utils"; - -.filter-section { - &-left { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - - .search-box { - // flex-grow: 1; - width: 100%; - - .search-input { - width: 100%; - padding: 12px 20px; - } - } - } - - &-right { - .network-switcher { - position: relative; - cursor: pointer; - - .selected-item { - box-sizing: border-box; - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - width: 230px; - height: 50px; - padding: 15px; - background: var(--common-containerBackgroundColor); - box-shadow: 0 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - cursor: pointer; - } - - .text-field { - display: inline-block; - background: var(--common-containerBackgroundColor); - color: var(--common-textColor); - border: none; - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 18px; - line-height: 150%; - flex-grow: 1; - width: 100%; - cursor: pointer; - - &:focus-visible { - outline: none; - } - @media screen and (max-width: 960px) { - font-size: 13px; - } - } - - .arrow { - display: inline-block; - margin-right: 8px; - width: 11px; - height: auto; - color: var(--common-textColor); - } - - .list { - display: none; - position: absolute; - left: 0; - top: 54px; - width: 200px; - border-radius: 8px; - background: var(--common-blockItemBackgroundColor); - z-index: 10; - - &-item { - padding: 20px 15px; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 14px; - line-height: 150%; - cursor: pointer; - - &:hover { - background: var(--common-blockItemBackgroundColorDarken); - } - } - } - } - } -} diff --git a/src/components/Ibc/FilterSection/index.js b/src/components/Ibc/FilterSection/index.js deleted file mode 100644 index cae33396b..000000000 --- a/src/components/Ibc/FilterSection/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import FilterSection from "./FilterSection"; - -export default FilterSection; diff --git a/src/components/Ibc/RelayersAssetSearch/RelayersAssetSearch.js b/src/components/Ibc/RelayersAssetSearch/RelayersAssetSearch.js deleted file mode 100644 index b87d9dc21..000000000 --- a/src/components/Ibc/RelayersAssetSearch/RelayersAssetSearch.js +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable react-hooks/exhaustive-deps */ -import React, {memo, useState, useEffect, useRef} from "react"; -import cn from "classnames/bind"; -import _ from "lodash"; -import DownAngleIcon from "src/icons/DownAngleIcon"; -import styles from "./RelayersAssetSearch.module.scss"; - -const cx = cn.bind(styles); - -const assetsNetworks = ["Received", "Transfer"]; -export default function({assetSearch, setAssetSearch, total}) { - const selectedItemRef = useRef(null); - const listRef = useRef(null); - const showList = () => { - if (!_.isNil(listRef.current)) { - listRef.current.style.display = "block"; - } - }; - - const hideList = () => { - if (!_.isNil(listRef.current)) { - listRef.current.style.display = "none"; - } - }; - - const clickListener = event => { - if (event?.target?.hasAttribute("data-relayers-assets")) { - hideList(); - setAssetSearch(assetsNetworks.findIndex(e => e === event?.target?.getAttribute("data-relayers-assets"))); - return; - } - - if (selectedItemRef?.current?.contains?.(event?.target)) { - if (listRef?.current?.style?.display === "block") { - hideList(); - } else { - showList(); - } - return; - } - - if (!_.isNil(listRef.current) && !listRef?.current?.contains?.(event?.target)) { - hideList(); - } - }; - - useEffect(() => { - document.addEventListener("click", clickListener, true); - - return () => { - document.removeEventListener("click", clickListener); - }; - }, []); - - return ( -
-
- Relayed Assets {total} -
-
-
-
- - -
-
- {assetsNetworks.map((item, index) => ( -
- {item} -
- ))} -
-
-
-
- ); -} diff --git a/src/components/Ibc/RelayersAssetSearch/RelayersAssetSearch.module.scss b/src/components/Ibc/RelayersAssetSearch/RelayersAssetSearch.module.scss deleted file mode 100644 index 37606492a..000000000 --- a/src/components/Ibc/RelayersAssetSearch/RelayersAssetSearch.module.scss +++ /dev/null @@ -1,101 +0,0 @@ -@import "src/styles/utils"; - -.assets { - &__search { - display: flex; - justify-content: space-between; - flex-direction: row; - align-items: center; - margin-bottom: 20px; - }; - &__title { - display: inline-block; - margin-right: 8px; - font-family: ''IBM Plex Sans''; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 150%; - color: white; - // vertical-align: middle; - }; - &__total { - color: #89909b; - font-family: 'IBM Plex Sans'; - } -} - -.network-switcher { - position: relative; - cursor: pointer; -} - -.selected-item { - box-sizing: border-box; - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - width: 150px; - height: 30px; - padding: 15px; - background: var(--common-containerBackgroundColor); - border: 1px solid var(--common-borderColor); - border-radius: 8px; - cursor: pointer; -} - -.text-field { - display: inline-block; - background: var(--common-containerBackgroundColor); - color: var(--common-textColor); - border: none; - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 13px; - line-height: 150%; - flex-grow: 1; - width: 100%; - cursor: pointer; - - &:focus-visible { - outline: none; - } -} - -.arrow { - display: inline-block; - margin-right: 8px; - width: 11px; - height: auto; - color: var(--common-textColor); -} - -.list { - display: none; - position: absolute; - left: 0; - top: 30px; - width: 150px; - border-radius: 8px; - background: var(--common-containerBackgroundColor); - z-index: 10; - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - - &-item { - padding: 10px 10px; - border-bottom: 1px solid var(--common-borderColor); - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 13px; - line-height: 150%; - cursor: pointer; - - &:hover { - background: var(--common-blockItemBackgroundColor); - } - } -} diff --git a/src/components/Ibc/RelayersAssetSearch/index.js b/src/components/Ibc/RelayersAssetSearch/index.js deleted file mode 100644 index 0e39a7170..000000000 --- a/src/components/Ibc/RelayersAssetSearch/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import RelayersAssetSearch from "./RelayersAssetSearch"; - -export default RelayersAssetSearch; diff --git a/src/components/Ibc/RelayersAssetTable/RelayersAssetTable.js b/src/components/Ibc/RelayersAssetTable/RelayersAssetTable.js deleted file mode 100644 index be1729a23..000000000 --- a/src/components/Ibc/RelayersAssetTable/RelayersAssetTable.js +++ /dev/null @@ -1,80 +0,0 @@ -import React, {memo, useMemo} from "react"; -import {NavLink} from "react-router-dom"; -import classNames from "classnames/bind"; -import consts from "src/constants/consts"; -import {formatOrai, formatNumber, parseIbc} from "src/helpers/helper"; -import {_, reduceString, reduceStringAssets} from "src/lib/scripts"; -import {tableThemes} from "src/constants/tableThemes"; -import ThemedTable from "src/components/common/ThemedTable"; -import styles from "./RelayersAssetTable.module.scss"; - -const cx = classNames.bind(styles); - -export const getHeaderRow = () => { - const nameHeaderCell =
Name
; - const totalTxsHeaderCell =
Total Txs
; - const totalAmountHeaderCell =
Total Amount
; - const totalValueHeaderCell =
Total Value
; - const headerCells = [nameHeaderCell, totalTxsHeaderCell, totalAmountHeaderCell, totalValueHeaderCell]; - const headerCellStyles = [ - {minWidth: "140px"}, // Name - {minWidth: "60px"}, // Total Txs - {minWidth: "60px"}, // Total Amount - {minWidth: "60px"}, // Total Value - ]; - - return { - headerCells, - headerCellStyles, - }; -}; - -const RelayersAssetTable = memo(({data = []}) => { - const getDataRows = data => { - if (!Array.isArray(data)) { - return []; - } - - return data.map(item => { - const logoURL = item?.images?.thumb; - const nameDataCell = _.isNil(item?.channel_id) ? ( -
-
- ) : ( -
- {logoURL && /} - {!logoURL &&
{item?.denom.substring(0, 3).toUpperCase()}
} -
-
{parseIbc(item?.denom)}
-
{item?.channel_id}
-
-
- ); - const totalTxsDataCell = _.isNil(item?.total_txs) ? ( -
-
- ) : ( -
{formatNumber(item.total_txs)}
- ); - - const totalAmountDataCell = _.isNil(item?.amount) ? ( -
-
- ) : ( -
{formatNumber(item.amount.toFixed(6))}
- ); - - const totalValueDataCell = _.isNil(item?.total_value) ? ( -
-
- ) : ( -
$ {formatNumber(item.total_value.toFixed(6))}
- ); - - return [nameDataCell, totalTxsDataCell, totalAmountDataCell, totalValueDataCell]; - }); - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(data), [data]); - - return ; -}); - -export default RelayersAssetTable; diff --git a/src/components/Ibc/RelayersAssetTable/RelayersAssetTable.module.scss b/src/components/Ibc/RelayersAssetTable/RelayersAssetTable.module.scss deleted file mode 100644 index a1eee44a2..000000000 --- a/src/components/Ibc/RelayersAssetTable/RelayersAssetTable.module.scss +++ /dev/null @@ -1,49 +0,0 @@ -@import "src/styles/utils"; - -.align-left { - text-align: left; -} - -.align-right { - text-align: right; -} - -.header-cell { - color: var(--common-linkColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: bold; - font-size: 14px; - line-height: 150%; -} - - -.logo-brand-custom { - display: flex; - align-items: center; -} - - -.name-data { - padding-left: 13px; -} - -.denom { - text-transform: uppercase; -} - -.channel { - color: #89909b; -} - -.logo-custom { - border-radius: 50%; - border: 1px solid var(--validators-logo-border); - padding: 5px; - margin-right: 5px; - width: 35px; - height: 35px; - display: flex; - align-items: center; - justify-content: center; -} diff --git a/src/components/Ibc/RelayersAssetTable/RelayersAssetsTableSkeleton.js b/src/components/Ibc/RelayersAssetTable/RelayersAssetsTableSkeleton.js deleted file mode 100644 index fb7a981ce..000000000 --- a/src/components/Ibc/RelayersAssetTable/RelayersAssetsTableSkeleton.js +++ /dev/null @@ -1,49 +0,0 @@ -import React, {memo, useMemo} from "react"; -import Skeleton from "@material-ui/lab/Skeleton"; -import classNames from "classnames/bind"; -import {tableThemes} from "src/constants/tableThemes"; -import ThemedTable from "src/components/common/ThemedTable"; -import {getHeaderRow} from "src/components/Ibc/RelayersAssetTable/RelayersAssetTable"; -import styles from "./RelayersAssetTable.module.scss"; - -const RelayersAssetsTableSkeleton = memo(({rows = 4}) => { - const cx = classNames.bind(styles); - const getDataRows = rows => { - let dataRows = []; - for (let i = 1; i <= rows; i++) { - const nameDataCell = ( -
- -
- ); - - const totalTxsDataCell = ( -
- -
- ); - - const totalAmountDataCell = ( -
- -
- ); - - const totalValueDataCell = ( -
- -
- ); - - dataRows.push([nameDataCell, totalTxsDataCell, totalAmountDataCell, totalValueDataCell]); - } - return dataRows; - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(rows), [rows]); - - return ; -}); - -export default RelayersAssetsTableSkeleton; diff --git a/src/components/Ibc/RelayersAssetTable/index.js b/src/components/Ibc/RelayersAssetTable/index.js deleted file mode 100644 index 068231f87..000000000 --- a/src/components/Ibc/RelayersAssetTable/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./RelayersAssetTable"; diff --git a/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList.js b/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList.js deleted file mode 100644 index f4a463a31..000000000 --- a/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList.js +++ /dev/null @@ -1,81 +0,0 @@ -// @ts-nocheck -import React, {memo} from "react"; -import {NavLink} from "react-router-dom"; -import classNames from "classnames/bind"; -import consts from "src/constants/consts"; -import {formatOrai, formatNumber, parseIbc} from "src/helpers/helper"; -import {_, reduceString, reduceStringAssets} from "src/lib/scripts"; -import styles from "./RelayersAssetsTableCardList.module.scss"; - -const cx = classNames.bind(styles); - -const RelayersAssetsTableCardList = memo(({data = []}) => { - return ( -
- {data.map((item, index) => { - return ( -
- - - - - - - - - - - - - - - - -
-
Name
-
- {_.isNil(item?.total_txs) ? ( -
-
- ) : ( -
-
{parseIbc(item?.denom)}
-
{item?.channel_id}
-
- )} -
-
Total Txs
- {_.isNil(item?.total_txs) ? ( -
-
- ) : ( -
-
{formatNumber(item.total_txs)}
-
- )} -
-
Total Amount
- {_.isNil(item?.amount) ? ( -
-
- ) : ( -
-
{formatNumber(item.amount)}
-
- )} -
-
Total Value
-
- {_.isNil(item?.total_value) ? ( -
-
- ) : ( -
-
$ {formatNumber(item.total_value)}
-
- )} -
-
- ); - })} -
- ); -}); - -export default RelayersAssetsTableCardList; diff --git a/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList.module.scss b/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList.module.scss deleted file mode 100644 index 9e941f9a4..000000000 --- a/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList.module.scss +++ /dev/null @@ -1,73 +0,0 @@ -@import "src/styles/utils"; - -.delegation-card-list { - &-item { - padding: 15px; - margin-bottom: 15px; - background-color: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - - table { - width: 100%; - tr { - td:nth-child(1) { - text-align: left; - width: 50%; - } - td:nth-child(2) { - text-align: right; - width: 50%; - } - - &:nth-child(1) { - td { - padding-bottom: 15px; - } - } - } - } - - .item-title { - color: var(--common-textColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 150%; - } - - .item-text { - color: var(--common-oraiDenomTextColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - - .item-link { - color: var(--common-oraiDenomTextColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - } -} -.denom { - display: inline-block; - color: var(--common-oraiDenomTextColor); - text-transform: uppercase; -} - -.value-data, -.txs-data, -.amount-data { - color: var(--common-oraiDenomTextColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; -} - diff --git a/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardListSkeleton.js b/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardListSkeleton.js deleted file mode 100644 index e5ad51bca..000000000 --- a/src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardListSkeleton.js +++ /dev/null @@ -1,54 +0,0 @@ -import React, {memo} from "react"; -import Skeleton from "@material-ui/lab/Skeleton"; -import classNames from "classnames/bind"; -import styles from "./RelayersAssetsTableCardList.module.scss"; - -const DelegationCardListSkeleton = memo(({rows = 5}) => { - const cx = classNames.bind(styles); - - let delegationCardListItems = []; - for (let i = 1; i <= rows; i++) { - delegationCardListItems.push( -
- - - - - - - - - - - - - - - -
-
Name
-
-
- -
-
-
Total Txs
- -
-
Total Amount
- -
-
Total Value
-
-
- -
-
-
- ); - } - - return
{delegationCardListItems}
; -}); - -export default DelegationCardListSkeleton; diff --git a/src/components/Ibc/RelayersAssetsTableCardList/index.js b/src/components/Ibc/RelayersAssetsTableCardList/index.js deleted file mode 100644 index dc4581572..000000000 --- a/src/components/Ibc/RelayersAssetsTableCardList/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./RelayersAssetsTableCardList"; diff --git a/src/components/Ibc/StatusCard/StatusCard.js b/src/components/Ibc/StatusCard/StatusCard.js deleted file mode 100644 index 7b0a4000e..000000000 --- a/src/components/Ibc/StatusCard/StatusCard.js +++ /dev/null @@ -1,21 +0,0 @@ -import React, {memo} from "react"; -import cn from "classnames/bind"; -import {_} from "src/lib/scripts"; -import styles from "./StatusCard.module.scss"; - -const cx = cn.bind(styles); - -const StatusCard = memo(({icon, label, value, comment}) => ( -
-
-
{icon}
- {label} -
-
-
{comment}
- {!_.isNil(value) &&
{value}
} -
-
-)); - -export default StatusCard; diff --git a/src/components/Ibc/StatusCard/StatusCard.module.scss b/src/components/Ibc/StatusCard/StatusCard.module.scss deleted file mode 100644 index f1e443387..000000000 --- a/src/components/Ibc/StatusCard/StatusCard.module.scss +++ /dev/null @@ -1,56 +0,0 @@ -@import "src/styles/utils"; - -.status-card { - padding: 20px; - background: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - height: 100%; - - &-header { - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - height: 24px; - margin-bottom: 30px; - } - &-body { - text-align: right; - } -} - -.status { - &-icon { - display: inline-flex; - margin-right: 8px; - color: var(--common-textColor); - } - - &-label { - color: var(--common-textColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - - &-value { - color: var(--common-textColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: 600; - font-size: 16px; - line-height: 150%; - } - - &-comment { - color: var(--common-textColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - } -} diff --git a/src/components/Ibc/StatusCard/index.js b/src/components/Ibc/StatusCard/index.js deleted file mode 100644 index fa8876f21..000000000 --- a/src/components/Ibc/StatusCard/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./StatusCard"; diff --git a/src/components/Ibc/StatusCardList/StatusCardList.js b/src/components/Ibc/StatusCardList/StatusCardList.js deleted file mode 100644 index 04c892501..000000000 --- a/src/components/Ibc/StatusCardList/StatusCardList.js +++ /dev/null @@ -1,52 +0,0 @@ -// @ts-nocheck -import React, {memo} from "react"; -import cn from "classnames/bind"; -import Grid from "@material-ui/core/Grid"; -import Skeleton from "@material-ui/lab/Skeleton"; -import {formatInteger, formatSeconds, formatNumber, formatFloat} from "src/helpers/helper"; -import StatusCard from "../StatusCard"; -import IbcTabIcon from "src/icons/Tabs/IbcTabIcon"; -import BondedTokensIcon from "src/icons/Validators/BondedTokensIcon"; -import BlockTimeIcon from "src/icons/Validators/BlockTimeIcon"; -import moment from "moment"; -import styles from "./StatusCardList.module.scss"; - -const cx = cn.bind(styles); - -const StatusCardList = memo(({relayerInfoData}) => { - let data = [ - { - // icon: , - label: "Well-known", - comment: "Total Transfer value", - value: `$ ${formatNumber(relayerInfoData?.total_value) || 0}`, - }, - { - icon: , - label: "IBC Total Txs", - value: relayerInfoData?.total_txs, - }, - { - icon: , - label: "Last Update Time", - value: moment(relayerInfoData?.last_updated).fromNow(), - }, - { - icon: , - label: "Operating Period", - value: moment(relayerInfoData?.channel?.created_at).fromNow(true), - }, - ]; - - return ( - - {data.map((item, index) => ( - - - - ))} - - ); -}); - -export default StatusCardList; diff --git a/src/components/Ibc/StatusCardList/StatusCardList.module.scss b/src/components/Ibc/StatusCardList/StatusCardList.module.scss deleted file mode 100644 index 0531f3b7f..000000000 --- a/src/components/Ibc/StatusCardList/StatusCardList.module.scss +++ /dev/null @@ -1,15 +0,0 @@ -@import "src/styles/utils"; - -.status-card-list { - margin-bottom: 20px; -} - -.skeleton { - &-block { - display: block; - } - - &-inline-block { - display: inline-block; - } -} diff --git a/src/components/Ibc/StatusCardList/index.js b/src/components/Ibc/StatusCardList/index.js deleted file mode 100644 index fb88f581c..000000000 --- a/src/components/Ibc/StatusCardList/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./StatusCardList"; diff --git a/src/components/PriceFeeds/FilterSection/FilterSection.js b/src/components/PriceFeeds/FilterSection/FilterSection.js deleted file mode 100644 index d75246274..000000000 --- a/src/components/PriceFeeds/FilterSection/FilterSection.js +++ /dev/null @@ -1,106 +0,0 @@ -import React, {useEffect, useRef} from "react"; -import PropTypes from "prop-types"; -import Grid from "@material-ui/core/Grid"; -import cn from "classnames/bind"; -import SearchInput from "src/components/common/SearchInput"; -import styles from "./FilterSection.module.scss"; -import DownAngleIcon from "src/icons/DownAngleIcon"; -import {priceFeedNetworks} from "src/constants/priceFeed"; -import _ from "lodash"; - -const cx = cn.bind(styles); - -const FilterSection = ({keyword, setKeyword, network, setNetwork}) => { - const selectedPriceFeedNetworkRef = useRef(null); - const listPriceFeedNetworks = useRef(null); - - const showList = () => { - if (!_.isNil(listPriceFeedNetworks.current)) { - listPriceFeedNetworks.current.style.display = "block"; - } - }; - - const hideList = () => { - if (!_.isNil(listPriceFeedNetworks.current)) { - listPriceFeedNetworks.current.style.display = "none"; - } - }; - - const clickListener = event => { - if (event?.target?.hasAttribute("price-feed-network")) { - setNetwork(event?.target?.getAttribute("price-feed-network")); - } - - if (selectedPriceFeedNetworkRef?.current?.contains?.(event?.target)) { - if (listPriceFeedNetworks?.current?.style?.display === "block") { - hideList(); - } else { - showList(); - } - return; - } - - if (!_.isNil(listPriceFeedNetworks.current) && !listPriceFeedNetworks?.current?.contains?.(event?.target)) { - hideList(); - } - }; - - useEffect(() => { - document.addEventListener("click", clickListener, true); - - return () => { - document.removeEventListener("click", clickListener); - }; - }, []); - - return ( - - -
- { - const query = { - search: e.target.value, - }; - setKeyword(e.target.value); - // history.push({ - // pathname: `${history.location.pathname}`, - // search: queryString.stringify(query, { - // encode: false, - // }), - // }); - }} - /> -
-
- -
-
- - -
-
- {Object.values(priceFeedNetworks).map((item, index) => ( -
- {item} -
- ))} -
-
-
-
- ); -}; - -FilterSection.propTypes = { - isGridView: PropTypes.bool, - keyword: PropTypes.string, - setIsGridView: PropTypes.func, - setKeyword: PropTypes.func, -}; -FilterSection.defaultProps = {}; - -export default FilterSection; diff --git a/src/components/PriceFeeds/FilterSection/FilterSection.module.scss b/src/components/PriceFeeds/FilterSection/FilterSection.module.scss deleted file mode 100644 index 3a878ae3e..000000000 --- a/src/components/PriceFeeds/FilterSection/FilterSection.module.scss +++ /dev/null @@ -1,97 +0,0 @@ -@import "src/styles/utils"; - -.filter-section { - &-left { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - - .search-box { - // flex-grow: 1; - width: 100%; - - .search-input { - width: 100%; - padding: 12px 20px; - } - } - } - - &-right { - .network-switcher { - position: relative; - cursor: pointer; - - .selected-item { - box-sizing: border-box; - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - width: 230px; - height: 50px; - padding: 15px; - background: var(--common-containerBackgroundColor); - box-shadow: 0 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - cursor: pointer; - } - - .text-field { - display: inline-block; - background: var(--common-containerBackgroundColor); - color: var(--common-textColor); - border: none; - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 18px; - line-height: 150%; - flex-grow: 1; - width: 100%; - cursor: pointer; - - &:focus-visible { - outline: none; - } - } - - .arrow { - display: inline-block; - margin-right: 8px; - width: 11px; - height: auto; - color: var(--common-textColor); - } - - .list { - display: none; - position: absolute; - left: 0; - top: 54px; - width: 200px; - border-radius: 8px; - background: var(--common-blockItemBackgroundColor); - z-index: 10; - - &-item { - padding: 20px 15px; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 14px; - line-height: 150%; - cursor: pointer; - - &:hover { - background: var(--common-blockItemBackgroundColorDarken); - } - } - } - } - } -} diff --git a/src/components/PriceFeeds/FilterSection/index.js b/src/components/PriceFeeds/FilterSection/index.js deleted file mode 100644 index cae33396b..000000000 --- a/src/components/PriceFeeds/FilterSection/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import FilterSection from "./FilterSection"; - -export default FilterSection; diff --git a/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridView.js b/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridView.js deleted file mode 100644 index b3750b833..000000000 --- a/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridView.js +++ /dev/null @@ -1,149 +0,0 @@ -/* eslint-disable jsx-a11y/anchor-has-content */ -/* eslint-disable no-undef */ -import React, { useEffect, useRef, useState } from "react"; -import PropTypes from "prop-types"; -import Grid from "@material-ui/core/Grid"; -import cn from "classnames/bind"; -import { _ } from "src/lib/scripts"; -import NumberFormat from "react-number-format"; -import { Tooltip } from "@material-ui/core"; -import CheckIcon from "src/icons/CheckIcon"; -import TimesIcon from "src/icons/TimesIcon"; -import { getTotalTime, setAgoTime } from "src/lib/scripts"; -import { pricePair } from "src/constants/priceFeed"; -import { priceFeedNetworks } from "src/constants/priceFeed"; -import TransactionModal from "../Transactions"; -import styles from "./PriceFeedsGridView.module.scss"; -import { isNil } from "lodash"; - -const cx = cn.bind(styles); - -const PriceFeedsGridView = ({ priceData, lastUpdate, keyword, requestData, network }) => { - const [showData, setShowData] = useState([]); - const [showModal, setShowModal] = useState(false); - const [renewTimeAgo, setRenewTimeAgo] = useState(0); - const bscRef = useRef(); - const polygonRef = useRef(); - - useEffect(() => { - if (!isNil(priceData)) { - let newData = []; - if (keyword) { - priceData.map(v => { - if (v.name.toLowerCase().includes(keyword.toLowerCase())) { - v.price > 0 ? newData.push({ ...v, status: "Active" }) : newData.push({ ...v, status: "Inactive" }); - } - }); - } else { - priceData.map(v => { - v.price > 0 ? newData.push({ ...v, status: "Active" }) : newData.push({ ...v, status: "Inactive" }); - }); - } - setShowData(newData); - } - }, [priceData, keyword]); - - const handleCloseModal = () => { - setShowModal(false); - }; - - const handleOpenModal = () => { - if (network === priceFeedNetworks.BSC_TESTNET) { - return bscRef?.current?.click(); - } - - if (network === priceFeedNetworks.POLYGON) { - return polygonRef?.current?.click(); - } - - setShowModal(true); - }; - - useEffect(() => { - const renewInterval = setInterval(() => { - setRenewTimeAgo(v => v + 1); - }, 5000); - return () => { - clearInterval(renewInterval); - }; - }, []); - - return ( - - ); -}; - -PriceFeedsGridView.propTypes = { - data: PropTypes.any, -}; -PriceFeedsGridView.defaultProps = { - data: [], -}; - -export default PriceFeedsGridView; diff --git a/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridView.module.scss b/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridView.module.scss deleted file mode 100644 index 82efe659c..000000000 --- a/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridView.module.scss +++ /dev/null @@ -1,141 +0,0 @@ -@import "src/styles/utils"; - -.bsc-link { - display: none; -} - -.price-feeds { - margin-top: 20px; - padding: 30px; - background: var(--common-containerBackgroundColor); - box-shadow: 0 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - - &-header { - margin-bottom: 25px; - - &-name { - margin-right: 8px; - font-family: 'IBM Plex Sans'; - font-style: normal; - font-size: 20px; - font-weight: 500; - line-height: 150%; - color: var(--common-textColor); - } - } - - &-card { - &-skeleton { - width: 100%; - } - - height: 100%; - padding: 20px; - color: var(--common-textColor); - background: var(--common-containerBackgroundColor); - border: 1px solid var(--common-borderColor); - box-sizing: border-box; - border-radius: 8px; - - &:hover { - background: var(--price-feed-hover); - } - - &-pair { - display: flex; - flex-direction: row; - align-items: center; - - &-icon { - margin-right: 10px; - width: 24px; - height: 24px; - } - - &-text { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 16px; - line-height: 150%; - word-break: break-all; - } - } - - &-price { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - margin-top: 15px; - cursor: pointer; - } - - &-info { - display: flex; - flex-direction: column; - // justify-content: space-between; - - &-item { - margin-top: 6px; - - &-header { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - - &-wrap { - display: flex; - justify-content: space-between; - - &-body { - display: flex; - flex-direction: row; - align-items: center; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - - .status-icon { - margin-right: 10px; - width: 16px; - height: 16px; - - &-active { - color: var(--common-resultIconSuccessColor); - } - - &-inactive { - color: var(--common-resultIconFailureColor); - } - } - - .status-text { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 16px; - line-height: 150%; - } - } - } - } - } - } -} - -.skeleton { - display: inline-block; -} diff --git a/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridViewSkeleton.js b/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridViewSkeleton.js deleted file mode 100644 index 27c9528bf..000000000 --- a/src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridViewSkeleton.js +++ /dev/null @@ -1,56 +0,0 @@ -import React from "react"; -import PropTypes from "prop-types"; -import Grid from "@material-ui/core/Grid"; -import Skeleton from "@material-ui/lab/Skeleton"; -import cn from "classnames/bind"; -import styles from "./PriceFeedsGridView.module.scss"; - -const cx = cn.bind(styles); - -const PriceFeedsGridViewSkeleton = ({rows}) => { - let requestGridViewItem = []; - - for (let i = 0; i < rows; i++) { - requestGridViewItem.push( - -
-
- - -
-
- -
-
- -
-
-
- ); - } - - return ( -
-
- - {" "} - Offer the precise and fast prices of famous cryptocurrencies powered by the AI Oracle technology. - -
-
- - {requestGridViewItem} - -
-
- ); -}; - -PriceFeedsGridViewSkeleton.propTypes = { - rows: PropTypes.number, -}; -PriceFeedsGridViewSkeleton.defaultProps = { - rows: 12, -}; - -export default PriceFeedsGridViewSkeleton; diff --git a/src/components/PriceFeeds/PriceFeedsGridView/index.js b/src/components/PriceFeeds/PriceFeedsGridView/index.js deleted file mode 100644 index 3dc0fb16c..000000000 --- a/src/components/PriceFeeds/PriceFeedsGridView/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import PriceFeedsGridView from "./PriceFeedsGridView"; - -export default PriceFeedsGridView; diff --git a/src/components/PriceFeeds/Transactions/TransactionModal.js b/src/components/PriceFeeds/Transactions/TransactionModal.js deleted file mode 100644 index 2d9b87fae..000000000 --- a/src/components/PriceFeeds/Transactions/TransactionModal.js +++ /dev/null @@ -1,79 +0,0 @@ -// @ts-nocheck -import React, {memo, useState, useEffect} from "react"; -import cn from "classnames/bind"; -import {useForm, FormProvider} from "react-hook-form"; -import {withStyles} from "@material-ui/core/styles"; -import {useSelector} from "react-redux"; -import Dialog from "@material-ui/core/Dialog"; -import axios from "axios"; -import consts from "src/constants/consts"; -import LoadingOverlay from "src/components/common/LoadingOverlay"; -import TransactionTable from "./TransactionTable"; -import {element} from "prop-types"; -import styles from "./TransactionModal.module.scss"; - -const cx = cn.bind(styles); - -const TransactionModal = ({open, closeDialog, requestData}) => { - const [txTableData, setTxTableData] = useState([]); - const [loading, setLoading] = useState(false); - - useEffect(() => { - async function getTxTableData() { - setLoading(true); - const results = []; - const blockHeights = []; - if (!requestData) { - setLoading(false); - return; - } - // for (let i = 0; i < requestData.reports.length; i++) { - // // const blockHeight = reports[i].block_height; - // // if (blockHeights.includes(blockHeight)) { - // // continue; - // // } else { - // // blockHeights.push(blockHeight); - // // } - // const { data: transactionInfor } = await axios.get( - // `${consts.LCD_API_BASE}${consts.LCD_API.AI_REQUEST_DATA}?events=wasm.contract_address%3D%27${process.env.REACT_APP_AIORACLE_CONTRACT_ADDR}%27&events=wasm.request_id%3D%27${requestData.request_id}%27&events=wasm.function_type%3D%27aggregate_and_report%27&order_by=2` - // ); - - // if (transactionInfor && transactionInfor.tx_responses && transactionInfor.tx_responses.length) { - // transactionInfor.tx_responses.forEach(tx => { - // results.push({ - // requestID: requestData.request_id, - // blockHeight: tx.height, - // txhash: tx.txhash, - // }); - // }); - // } - // } - results.push({ - requestID: requestData[0], - blockHeight: requestData[1], - txhash: requestData[2], - }); - setTxTableData(results); - setLoading(false); - } - - if (open) { - getTxTableData(); - } - }, [requestData, open]); - - if (loading) { - return ; - } - - return ( - -
-
List Transactions Report Price
- -
-
- ); -}; - -export default TransactionModal; diff --git a/src/components/PriceFeeds/Transactions/TransactionModal.module.scss b/src/components/PriceFeeds/Transactions/TransactionModal.module.scss deleted file mode 100644 index 2a59d8c4b..000000000 --- a/src/components/PriceFeeds/Transactions/TransactionModal.module.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import "src/styles/utils"; - -@mixin font-delegate { - font-family: "IBM Plex Sans"; - font-weight: 500; - font-size: 18px; - @include media(" { - const requestHeaderCell =
Request ID
; - const blockHeightHeaderCell =
Block Height
; - const txHeaderCell =
Tx
; - const headerCells = [requestHeaderCell, blockHeightHeaderCell, txHeaderCell]; - const headerCellStyles = [ - {minWidth: "100px"}, // Report ID - {minWidth: "100px"}, // Block Height - {minWidth: "130px"}, // Tx - ]; - return { - headerCells, - headerCellStyles, - }; -}; - -const TestCaseTable = memo(({ data = [] }) => { - const getDataRows = data => { - if (!Array.isArray(data)) { - return []; - } - data = data.filter((element, index, self) => index === self.findIndex(selfElement => selfElement.txhash === element.txhash)); - - return data.map(item => { - const requestCell = _.isNil(item?.requestID) ? ( -
-
- ) : ( - - {item.requestID} - - ); - - const blockHeightCell = _.isNil(item?.blockHeight) ? ( -
-
- ) : ( - - {item.blockHeight} - - ); - - const txCell = _.isNil(item?.txhash) ? ( -
-
- ) : ( - - {item.txhash} - - ); - - return [requestCell, blockHeightCell, txCell]; - }); - }; - - const headerRow = useMemo(() => getHeaderRow(), []); - const dataRows = useMemo(() => getDataRows(data), [data, getDataRows]); - - return ; -}); - -export default TestCaseTable; diff --git a/src/components/PriceFeeds/Transactions/TransactionTable.module.scss b/src/components/PriceFeeds/Transactions/TransactionTable.module.scss deleted file mode 100644 index e46c72492..000000000 --- a/src/components/PriceFeeds/Transactions/TransactionTable.module.scss +++ /dev/null @@ -1,74 +0,0 @@ -@import "src/styles/utils"; - -.align-left { - text-align: left; -} - -.align-right { - text-align: right; -} - -.align-center { - text-align: center; -} - -.header-cell { - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: bold; - font-size: 14px; - line-height: 150%; - color: var(--common-headerTextColor); -} - -.test-case-data-cell, -.description-data-cell, -.request-data-cell { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; -} - -.fee-data-cell { - .fee { - display: inline-flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - - &-value { - display: inline-block; - padding-right: 4px; - } - - &-denom { - display: inline-block; - text-transform: uppercase; - } - } -} - -.owner-data-cell { - .owner { - display: inline-block; - color: var(--common-linkColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 150%; - } -} - -.skeleton { - display: inline-block; -} diff --git a/src/components/PriceFeeds/Transactions/index.js b/src/components/PriceFeeds/Transactions/index.js deleted file mode 100644 index 2b85f430a..000000000 --- a/src/components/PriceFeeds/Transactions/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./TransactionModal"; diff --git a/src/components/Wallet/Tabs/Tabs.js b/src/components/Wallet/Tabs/Tabs.js index a71403a8d..f29b3be5b 100644 --- a/src/components/Wallet/Tabs/Tabs.js +++ b/src/components/Wallet/Tabs/Tabs.js @@ -22,10 +22,6 @@ export default function({activeTab, setActiveTab, isBecomeValidator, address}) {
Transactions
-
setActiveTab(1)}> - -
Royalty Transactions
-
{dataRes?.data && dataRes?.data?.length > 0 && (
setActiveTab(6)}>
CW-20 Token Txns
@@ -34,7 +30,6 @@ export default function({activeTab, setActiveTab, isBecomeValidator, address}) { {isBecomeValidator && (
setActiveTab(3)}> - {/*
{isBecomeValidator ? "Your Delegators" : "Become A Validator"}
*/}
Your Delegators
)} @@ -46,10 +41,6 @@ export default function({activeTab, setActiveTab, isBecomeValidator, address}) {
Contact
-
setActiveTab(5)}> - -
AI Executor
-
); } diff --git a/src/constants/consts.js b/src/constants/consts.js index f1480c92e..81d221edc 100644 --- a/src/constants/consts.js +++ b/src/constants/consts.js @@ -120,8 +120,6 @@ export default Object.freeze({ IBC_TOKENS: "/ibc/tokens", UPLOAD_IMAGES_VALIDATORS: "/validator/update-image", GET_IMAGES_VALIDATORS: "/validator-detail", - IBC_RELAYERS: "/ibc/relayers", - IBC_RELAYERS_DETAIL: "/ibc/relayers/channel", OW20_SMART_CONTRACTS: "/ow20_smart_contracts", OW20_CONTRACT: "/ow20_contract", OW20_TOKEN: "/ow20_tokens", diff --git a/src/containers/Ibc/Ibc.js b/src/containers/Ibc/Ibc.js deleted file mode 100644 index fde5001ea..000000000 --- a/src/containers/Ibc/Ibc.js +++ /dev/null @@ -1,141 +0,0 @@ -import React, {useState, useRef, useEffect} from "react"; -import {useHistory} from "react-router-dom"; -import {useTheme} from "@material-ui/core/styles"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -import Container from "@material-ui/core/Container"; -import cn from "classnames/bind"; -import {useGet} from "restful-react"; -import consts from "src/constants/consts"; -import {_} from "src/lib/scripts"; -import TogglePageBar from "src/components/common/TogglePageBar"; -import TitleWrapper from "src/components/common/TitleWrapper"; -import PageTitle from "src/components/common/PageTitle"; -import ChainBox from "src/components/common/ChainBox"; -import Pagination from "src/components/common/Pagination"; -import AssetsIbcTable from "src/components/Ibc/AssetsIbcTable/AssetsIbcTable"; -import AssetsIbcTableSkeleton from "src/components/Ibc/AssetsIbcTable/AssetsIbcTableSkeleton"; -import AssetsIbcCardList from "src/components/Ibc/AssetsIbcCardList/AssetsIbcCardList"; -import AssetsIbcCardListSkeleton from "src/components/Ibc/AssetsIbcCardList/AssetsIbcCardListSkeleton"; -import FilterSection from "src/components/Ibc/FilterSection"; -import styles from "./Ibc.module.scss"; -const cx = cn.bind(styles); - -const IbcAssets = props => { - const theme = useTheme(); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const history = useHistory(); - const [keyword, setKeyword] = useState(""); - const [chainValue, setChainValue] = useState(0); - const [assetSearch, setAssetSearch] = useState(0); - const [list, setList] = useState([]); - const getPaginationPath = (pathname, page) => { - return pathname + "?page=" + page; - }; - - const [total, setTotal] = useState(-1); - const searchParams = new URLSearchParams(props.location.search); - let page = parseFloat(searchParams.get("page")); - let isPageValid = true; - if (!Number.isInteger(page) || page < 1 || (total !== -1 && page > Math.ceil(total / consts.REQUEST.LIMIT))) { - page = 1; - isPageValid = false; - } - - const [showLoading, setShowLoading] = useState(true); - const [loadCompleted, setLoadCompleted] = useState(false); - let timerID = useRef(null); - - const basePath = `${consts.API_BASE}${consts.API.IBC_TOKENS}`; - const {data, loading, error} = useGet({ - path: basePath, - }); - - useEffect(() => { - if (data?.length > 0) { - let sumChainValue = data != null && data.reduce((acc, cur) => acc + cur?.prices?.TotalValue, 0); - setChainValue(sumChainValue); - setList(data); - } - }, [data]); - - useEffect(() => { - let listFilter = []; - if (!keyword && !assetSearch) { - listFilter = data; - } else { - if (keyword && !assetSearch) { - listFilter = data && data.filter(ele => ele.symbol.indexOf(keyword) !== -1); - } else if (!keyword && assetSearch) { - assetSearch === 0 ? (listFilter = data) : (listFilter = data && data.filter(ele => (assetSearch === 1 ? !ele.channelId : ele.channelId))); - } else { - listFilter = data && data.filter(ele => (assetSearch === 1 ? !ele.channelId : ele.channelId && ele.symbol.indexOf(keyword) !== -1)); - } - } - setList(listFilter); - }, [keyword, assetSearch]); - - let titleSection; - let filterSection; - let tableSection; - let paginationSection; - - titleSection = isLargeScreen ? ( - - - - - - - ) : ( - - ); - - if (!data || !list || (loading && showLoading)) { - filterSection = ( -
- -
-
- ); - tableSection = isLargeScreen ? : ; - } else { - filterSection = ( -
- { - setKeyword(e.target.value); - }} - /> -
- ); - tableSection = isLargeScreen ? : ; - } - - const onPageChange = page => { - setShowLoading(true); - history.push(getPaginationPath(props.location.pathname, page)); - }; - const totalItems = _.isNil(data?.result?.count) ? 0 : Math.ceil(parseInt(data.result.count)); - const totalPages = Math.ceil(data?.length / consts.REQUEST.LIMIT); - if (total !== totalItems) { - setTotal(totalItems); - } - paginationSection = totalPages > 0 && onPageChange(page)} />; - - return ( - <> - {titleSection} - - {filterSection} - {tableSection} - {paginationSection} - - - ); -}; - -export default IbcAssets; diff --git a/src/containers/Ibc/Ibc.module.scss b/src/containers/Ibc/Ibc.module.scss deleted file mode 100644 index 3a2ea6e66..000000000 --- a/src/containers/Ibc/Ibc.module.scss +++ /dev/null @@ -1,39 +0,0 @@ -@import "src/styles/utils"; - -.ibc-assets { - margin-bottom: 24px; - margin-top: 30px; - - @include media(" import("src/containers/Executors")); -const OracleRequests = lazy(() => import(`src/containers/OracleRequests`)); -const cx = cn.bind(styles); - -let tabsOracle = ["AI Request", "AI Executors"]; -export default function() { - const [status, setStatus] = useState("AI Request"); - let filterSection; - let tableOracle; - let filterData = tabsOracle.map(value => { - const filterItem = { - label: value, - value: value, - }; - return filterItem; - }); - - filterSection = ( - - { - setStatus(value); - }} - /> - - ); - - switch (status) { - case "AI Request": - tableOracle = ; - break; - case "AI Executors": - tableOracle = ; - break; - default: - tableOracle = <> ; - break; - } - - return ( - <> - {filterSection} - {tableOracle} - - ); -} diff --git a/src/containers/OracleAI/OracleAI.module.scss b/src/containers/OracleAI/OracleAI.module.scss deleted file mode 100644 index 8dcb410ae..000000000 --- a/src/containers/OracleAI/OracleAI.module.scss +++ /dev/null @@ -1,12 +0,0 @@ -.oracle { - margin-top: 0; - margin-bottom: 30px; - - @media (min-width: 1279px) { - margin-top: 30px; - } - - .filter-section { - margin-top: 0; - } -} diff --git a/src/containers/OracleAI/index.js b/src/containers/OracleAI/index.js deleted file mode 100644 index 506133eb4..000000000 --- a/src/containers/OracleAI/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import OracleAI from "./OracleAI"; - -export default OracleAI; diff --git a/src/containers/PriceFeeds/PriceFeeds.js b/src/containers/PriceFeeds/PriceFeeds.js deleted file mode 100644 index 6a18d936c..000000000 --- a/src/containers/PriceFeeds/PriceFeeds.js +++ /dev/null @@ -1,146 +0,0 @@ -// @ts-nocheck -import React, {useEffect, useState, useRef} from "react"; -import cn from "classnames/bind"; -import {useTheme} from "@material-ui/core/styles"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -import Container from "@material-ui/core/Container"; -import TitleWrapper from "src/components/common/TitleWrapper"; -import PageTitle from "src/components/common/PageTitle"; -import StatusBox from "src/components/common/StatusBox"; -import PriceFeedsGridView from "src/components/PriceFeeds/PriceFeedsGridView"; -import PriceFeedsGridViewSkeleton from "src/components/PriceFeeds/PriceFeedsGridView/PriceFeedsGridViewSkeleton"; -import TogglePageBar from "src/components/common/TogglePageBar"; -import FilterSection from "src/components/PriceFeeds/FilterSection"; -import styles from "./PriceFeeds.module.scss"; -import NoResult from "src/components/common/NoResult"; -import {pricePair} from "src/constants/priceFeed"; -import {getPriceBSCTestnet} from "./bsc-testnet"; -import {getPricePolygon} from "./polygon"; -import {getPriceFeedMainnet} from "./mainnet"; -import {priceFeedNetworks} from "src/constants/priceFeed"; - -const cx = cn.bind(styles); - -const PriceFeeds = ({}) => { - const theme = useTheme(); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const [keyword, setKeyword] = useState(""); - const [network, setNetwork] = useState(priceFeedNetworks.MAINNET); - const [isLoading, setIsLoading] = useState(false); - const networkRef = useRef(priceFeedNetworks.MAINNET); - - const [data, setData] = useState({ - data: [], - }); - const [renewPriceFeed, setRenewPriceFeed] = useState(0); - - let titleSection; - if (isLargeScreen) { - titleSection = ( - - - - - - - ); - } else { - titleSection = ; - } - - const handleChangeNetwork = n => { - networkRef.current = n; - setNetwork(n); - }; - - const filterSection = ; - - useEffect(() => { - const getPriceFeedORAI = async () => { - try { - setIsLoading(true); - const data = await getPriceFeedMainnet(); - networkRef.current === priceFeedNetworks.MAINNET && setData(data); - setIsLoading(false); - } catch (e) { - console.log("error", e); - networkRef.current === priceFeedNetworks.MAINNET && setData(null); - setIsLoading(false); - } - }; - - const getPriceFeedBSC = async () => { - try { - setIsLoading(true); - const data = await getPriceBSCTestnet(pricePair); - networkRef.current === priceFeedNetworks.BSC_TESTNET && setData(data); - setIsLoading(false); - } catch (e) { - console.log("error", e); - networkRef.current === priceFeedNetworks.BSC_TESTNET && setData(null); - setIsLoading(false); - } - }; - - const getPriceFeedPolygon = async () => { - try { - setIsLoading(true); - const data = await getPricePolygon(pricePair); - networkRef.current === priceFeedNetworks.POLYGON && setData(data); - setIsLoading(false); - } catch (e) { - console.log("error", e); - networkRef.current === priceFeedNetworks.POLYGON && setData(null); - setIsLoading(false); - } - }; - - if (network === priceFeedNetworks.BSC_TESTNET) { - getPriceFeedBSC(); - } else if (network === priceFeedNetworks.POLYGON) { - getPriceFeedPolygon(); - } else { - getPriceFeedORAI(); - } - }, [renewPriceFeed, network]); - - useEffect(() => { - let i = 0; - - const renewPriceInterval = setInterval(() => { - i && setRenewPriceFeed(v => v + 1); - i++; - }, 1000 * 60 * 2); - - return () => { - clearInterval(renewPriceInterval); - }; - }, []); - - const renderData = () => { - if (!data) { - return ; - } - - if (isLoading) { - return ; - } - - return ; - }; - - return ( - <> - {titleSection} - - {filterSection} - {renderData()} - - - ); -}; - -PriceFeeds.propTypes = {}; -PriceFeeds.defaultProps = {}; - -export default PriceFeeds; diff --git a/src/containers/PriceFeeds/PriceFeeds.module.scss b/src/containers/PriceFeeds/PriceFeeds.module.scss deleted file mode 100644 index 47ce32cf2..000000000 --- a/src/containers/PriceFeeds/PriceFeeds.module.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "src/styles/utils"; - -.price-feeds { - margin-top: 0; - margin-bottom: 50px; - - @include media(">=large") { - margin-top: 30px; - } -} diff --git a/src/containers/PriceFeeds/abj.js b/src/containers/PriceFeeds/abj.js deleted file mode 100644 index 4ebe1bec9..000000000 --- a/src/containers/PriceFeeds/abj.js +++ /dev/null @@ -1,303 +0,0 @@ -export const abiBsc = [ - {inputs: [], stateMutability: "nonpayable", type: "constructor"}, - { - anonymous: false, - inputs: [ - {indexed: true, internalType: "address", name: "previousOwner", type: "address"}, - {indexed: true, internalType: "address", name: "newOwner", type: "address"}, - ], - name: "OwnershipTransferred", - type: "event", - }, - {anonymous: false, inputs: [{indexed: false, internalType: "uint256", name: "blockNumber", type: "uint256"}], name: "PriceDataUpdate", type: "event"}, - {inputs: [], name: "DOMAIN_SEPARATOR", outputs: [{internalType: "bytes32", name: "", type: "bytes32"}], stateMutability: "view", type: "function"}, - {inputs: [], name: "EIP712DOMAIN_TYPEHASH", outputs: [{internalType: "bytes32", name: "", type: "bytes32"}], stateMutability: "view", type: "function"}, - {inputs: [], name: "NAME", outputs: [{internalType: "string", name: "", type: "string"}], stateMutability: "view", type: "function"}, - {inputs: [], name: "UPDATE_PRICE_TYPEHASH", outputs: [{internalType: "bytes32", name: "", type: "bytes32"}], stateMutability: "view", type: "function"}, - { - inputs: [{internalType: "string[]", name: "_symbols", type: "string[]"}], - name: "addAssetSupport", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{internalType: "address", name: "", type: "address"}], - name: "dataSubmitter", - outputs: [{internalType: "bool", name: "", type: "bool"}], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - {internalType: "string", name: "_base", type: "string"}, - {internalType: "string", name: "_quote", type: "string"}, - ], - name: "getPrice", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "lastUpdatedBase", type: "uint64"}, - {internalType: "uint64", name: "lastUpdatedQuote", type: "uint64"}, - ], - internalType: "struct IOraiBase.ResponsePriceData", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "string", name: "_symbol", type: "string"}], - name: "getPrice", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "resolveTime", type: "uint64"}, - ], - internalType: "struct IOraiBase.PriceData", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - {internalType: "string[]", name: "_bases", type: "string[]"}, - {internalType: "string[]", name: "_quotes", type: "string[]"}, - ], - name: "getPriceBulk", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "lastUpdatedBase", type: "uint64"}, - {internalType: "uint64", name: "lastUpdatedQuote", type: "uint64"}, - ], - internalType: "struct IOraiBase.ResponsePriceData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "string[]", name: "_bases", type: "string[]"}], - name: "getPriceBulk", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "resolveTime", type: "uint64"}, - ], - internalType: "struct IOraiBase.PriceData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "address", name: "", type: "address"}], - name: "nonces", - outputs: [{internalType: "uint256", name: "", type: "uint256"}], - stateMutability: "view", - type: "function", - }, - {inputs: [], name: "owner", outputs: [{internalType: "address", name: "", type: "address"}], stateMutability: "view", type: "function"}, - { - inputs: [{internalType: "uint16", name: "", type: "uint16"}], - name: "rPrices", - outputs: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "resolveTime", type: "uint64"}, - ], - stateMutability: "view", - type: "function", - }, - {inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function"}, - { - inputs: [ - {internalType: "address", name: "_submitter", type: "address"}, - {internalType: "bool", name: "approval", type: "bool"}, - ], - name: "setDataSubmitter", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{internalType: "string", name: "", type: "string"}], - name: "supportedAsset", - outputs: [{internalType: "uint16", name: "", type: "uint16"}], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "uint256", name: "", type: "uint256"}], - name: "symbols", - outputs: [{internalType: "string", name: "", type: "string"}], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "address", name: "newOwner", type: "address"}], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - {internalType: "uint16[]", name: "_symbolIds", type: "uint16[]"}, - {internalType: "uint128[]", name: "_rates", type: "uint128[]"}, - {internalType: "uint64[]", name: "_resolveTimes", type: "uint64[]"}, - ], - name: "updatePrice", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - {internalType: "uint16[]", name: "_symbolIds", type: "uint16[]"}, - {internalType: "uint128[]", name: "_rates", type: "uint128[]"}, - {internalType: "uint64[]", name: "_resolveTimes", type: "uint64[]"}, - {internalType: "uint256", name: "deadline", type: "uint256"}, - {internalType: "uint256", name: "nonce", type: "uint256"}, - {internalType: "uint8", name: "v", type: "uint8"}, - {internalType: "bytes32", name: "r", type: "bytes32"}, - {internalType: "bytes32", name: "s", type: "bytes32"}, - ], - name: "updatePricePermit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - {internalType: "bytes32", name: "hash", type: "bytes32"}, - {internalType: "uint256", name: "nonce", type: "uint256"}, - {internalType: "uint8", name: "v", type: "uint8"}, - {internalType: "bytes32", name: "r", type: "bytes32"}, - {internalType: "bytes32", name: "s", type: "bytes32"}, - ], - name: "verify", - outputs: [{internalType: "address", name: "sender", type: "address"}], - stateMutability: "nonpayable", - type: "function", - }, -]; - -export const abiPolygon = [ - {inputs: [{internalType: "contract IOraiBase", name: "_oracle", type: "address"}], stateMutability: "nonpayable", type: "constructor"}, - { - anonymous: false, - inputs: [ - {indexed: true, internalType: "address", name: "previousOwner", type: "address"}, - {indexed: true, internalType: "address", name: "newOwner", type: "address"}, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - inputs: [ - {internalType: "string", name: "_base", type: "string"}, - {internalType: "string", name: "_quote", type: "string"}, - ], - name: "getPrice", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "lastUpdatedBase", type: "uint64"}, - {internalType: "uint64", name: "lastUpdatedQuote", type: "uint64"}, - ], - internalType: "struct IOraiBase.ResponsePriceData", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "string", name: "_base", type: "string"}], - name: "getPrice", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "resolveTime", type: "uint64"}, - ], - internalType: "struct IOraiBase.PriceData", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - {internalType: "string[]", name: "_bases", type: "string[]"}, - {internalType: "string[]", name: "_quotes", type: "string[]"}, - ], - name: "getPriceBulk", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "lastUpdatedBase", type: "uint64"}, - {internalType: "uint64", name: "lastUpdatedQuote", type: "uint64"}, - ], - internalType: "struct IOraiBase.ResponsePriceData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [{internalType: "string[]", name: "_bases", type: "string[]"}], - name: "getPriceBulk", - outputs: [ - { - components: [ - {internalType: "uint128", name: "rate", type: "uint128"}, - {internalType: "uint64", name: "resolveTime", type: "uint64"}, - ], - internalType: "struct IOraiBase.PriceData[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - {inputs: [], name: "oracle", outputs: [{internalType: "contract IOraiBase", name: "", type: "address"}], stateMutability: "view", type: "function"}, - {inputs: [], name: "owner", outputs: [{internalType: "address", name: "", type: "address"}], stateMutability: "view", type: "function"}, - {inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function"}, - { - inputs: [{internalType: "contract IOraiBase", name: "_oracle", type: "address"}], - name: "setOracle", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [{internalType: "address", name: "newOwner", type: "address"}], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; diff --git a/src/containers/PriceFeeds/bsc-testnet.js b/src/containers/PriceFeeds/bsc-testnet.js deleted file mode 100644 index 9b249ac37..000000000 --- a/src/containers/PriceFeeds/bsc-testnet.js +++ /dev/null @@ -1,41 +0,0 @@ -import Web3 from "web3"; -import BigNumber from "bignumber.js"; -import _ from "lodash"; - -import {abiBsc} from "./abj"; - -const web3 = new Web3("https://data-seed-prebsc-1-s1.binance.org:8545"); -const contract = new web3.eth.Contract(abiBsc, "0x13f54d67fa23ab3caaef681553cd996f7e9d6237"); - -async function getPriceBSCTestnet(listPair) { - let lastUpdate = new Date().toString(); - const listPairResult = _.cloneDeep(listPair); - const listCoin = listPair.map(v => v.name); - const priceArr = await contract.methods["getPriceBulk"](listCoin).call({ - from: "0x0000000000000000000000000000000000000000", - latest: true, - }); - - console.log(priceArr, "== ==== === ="); - - for (let i = 0; i < listCoin.length; i++) { - if (!priceArr[i][0]) { - continue; - } - listPairResult[i].price = parseFloat( - new BigNumber(priceArr[i][0]) - .dividedBy(Math.pow(10, 18)) - .toFixed(9) - .toString() - ); - listPairResult[i].status = "Active"; - lastUpdate = new Date(parseInt(priceArr[i]["resolveTime"]) * 1000).toString(); - } - - return { - data: listPairResult, - lastUpdate, - }; -} - -export {getPriceBSCTestnet}; diff --git a/src/containers/PriceFeeds/index.js b/src/containers/PriceFeeds/index.js deleted file mode 100644 index c15271f7d..000000000 --- a/src/containers/PriceFeeds/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import PriceFeeds from "./PriceFeeds"; - -export default PriceFeeds; diff --git a/src/containers/PriceFeeds/mainnet.js b/src/containers/PriceFeeds/mainnet.js deleted file mode 100644 index e9a9d47e3..000000000 --- a/src/containers/PriceFeeds/mainnet.js +++ /dev/null @@ -1,59 +0,0 @@ -import axios from "axios"; -import config from "src/config"; -import { Buffer } from "buffer"; - -import consts from "src/constants/consts"; - -export const getAiOracleRequests = async () => { - const qData = { get_requests_by_service: { service: "orchai_price", limit: 10, order: 2 } }; - const encodeData = Buffer.from(JSON.stringify(qData)).toString("base64"); - - const endpoint = `${consts.LCD_API_BASE}${consts.LCD_API.WASM}/${config.AIORACLE_CONTRACT_ADDR}/smart/${encodeData}`; - const { data: fullRequestData } = await axios.get(endpoint); - - if (fullRequestData?.data?.length > 0) { - for (let stageData of fullRequestData.data) { - // only collect data from the latest stage that has merkle root. - if (stageData.merkle_root) { - return stageData.stage; - } - } - } -}; - -export const getRequestMerkleRootInfor = async stage => { - // url: events=wasm._contract_address='contract_address'&events=wasm.current_stage='stage'&events=wasm.action='register_merkle_root' - const { data: transactionInfor } = await axios.get( - `${consts.LCD_API_BASE}${consts.LCD_API.AI_REQUEST_DATA}` + - `?events=wasm._contract_address=${encodeURIComponent("'" + config.AIORACLE_CONTRACT_ADDR + "'")}` + - `&events=wasm.current_stage=${encodeURIComponent("'" + stage + "'")}` + - "&events=wasm.action='register_merkle_root'" - ); - - return [transactionInfor?.tx_responses[0].height, transactionInfor?.tx_responses[0].txhash]; -}; - -export const getPriceFeedMainnet = async () => { - // collect request id - const stage = await getAiOracleRequests(); - const [merkleRootHeight, merkleRootTxHash] = await getRequestMerkleRootInfor(stage); - if (stage) { - const { data: fullRequestData } = await axios.get( - `${config.AIORACLE_BACKEND}/report/reports?request_id=${parseInt(stage)}&contract_addr=${config.AIORACLE_CONTRACT_ADDR}` - ); - - if (fullRequestData?.data?.data.length > 0) { - let aggregatedResult = []; - aggregatedResult = fullRequestData.data.data.map(item => JSON.parse(atob(item.report.data))); - - // collect block data to display last updated info - const { data: blockData } = await axios.get(`${consts.API_BASE}/blocks?&limit=1&before=${parseInt(merkleRootHeight) + 1}`); - - return { - priceData: aggregatedResult[0], - lastUpdate: blockData?.data[0]?.timestamp, - requestData: [stage, merkleRootHeight, merkleRootTxHash], // only need request id to query the transaction hash of it - }; - } - } -}; diff --git a/src/containers/PriceFeeds/polygon.js b/src/containers/PriceFeeds/polygon.js deleted file mode 100644 index 42afb2cec..000000000 --- a/src/containers/PriceFeeds/polygon.js +++ /dev/null @@ -1,41 +0,0 @@ -import Web3 from "web3"; -import BigNumber from "bignumber.js"; -import _ from "lodash"; - -import {abiPolygon} from "./abj"; - -const web3 = new Web3("https://rpc-mumbai.matic.today"); -const contract = new web3.eth.Contract(abiPolygon, "0x95Fc3900DF04103abd466F276ff8DF98508af708"); - -async function getPricePolygon(listPair) { - let lastUpdate = new Date().toString(); - const listPairResult = _.cloneDeep(listPair); - const listCoin = listPair.map(v => v.name); - const priceArr = await contract.methods["getPriceBulk"](listCoin).call({ - from: "0x0000000000000000000000000000000000000000", - latest: true, - }); - - console.log(priceArr, "== ==== === ="); - - for (let i = 0; i < listCoin.length; i++) { - if (!priceArr[i][0]) { - continue; - } - listPairResult[i].price = parseFloat( - new BigNumber(priceArr[i][0]) - .dividedBy(Math.pow(10, 18)) - .toFixed(9) - .toString() - ); - listPairResult[i].status = "Active"; - lastUpdate = new Date(parseInt(priceArr[i]["resolveTime"]) * 1000).toString(); - } - - return { - data: listPairResult, - lastUpdate, - }; -} - -export {getPricePolygon}; diff --git a/src/containers/RelayerDetail/Relayer.js b/src/containers/RelayerDetail/Relayer.js deleted file mode 100644 index fe8911404..000000000 --- a/src/containers/RelayerDetail/Relayer.js +++ /dev/null @@ -1,135 +0,0 @@ -import React, {useCallback, useState, useRef} from "react"; -import cn from "classnames/bind"; -import Container from "@material-ui/core/Container"; -import {useGet} from "restful-react"; -import {useParams} from "react-router-dom"; -import {useTheme} from "@material-ui/core/styles"; -// components -import RelayerAsset from "./RelayerAssset"; -import Pagination from "src/components/common/Pagination"; -import StatusCardList from "src/components/Ibc/StatusCardList"; -import PageTitle from "src/components/common/PageTitle"; -// constants -import consts from "src/constants/consts"; -import TogglePageBar from "src/components/common/TogglePageBar"; -import TitleWrapper from "src/components/common/TitleWrapper"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -// styles -import styles from "./RelayerDetail.module.scss"; -import NoResult from "src/components/common/NoResult"; -import Grid from "@material-ui/core/Grid"; -import RelayersAssetSearch from "src/components/Ibc/RelayersAssetSearch"; -import RelayersAssetTable from "src/components/Ibc/RelayersAssetTable"; -import RelayersAssetsTableCardList from "src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardList"; - -import RelayersAssetsTableSkeleton from "src/components/Ibc/RelayersAssetTable/RelayersAssetsTableSkeleton"; - -import RelayersAssetsTableCardListSkeleton from "src/components/Ibc/RelayersAssetsTableCardList/RelayersAssetsTableCardListSkeleton"; -import RelayerTransactions from 'src/containers/RelayerDetail/RelayerTransactions'; - -const cx = cn.bind(styles); - -export const TX_TYPE = { - RECEIVE: "RECEIVE", - TRANSFER: "TRANSFER", -}; - -const RelayerDetail = () => { - const theme = useTheme(); - const {channelId} = useParams(); - const [pageId, setPageId] = React.useState(1); - const [assetSearch, setAssetSearch] = useState(0); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const totalPagesRef = useRef(null); - let statusCardList; - - let titleSection; - let relayerAssets; - let relayerTransactions; - let tableSection; - let paginationSection; - console.log("🚀 ~ file: index.js ~ line 29 ~ RelayerDetail ~ pagination"); - - const {data: relayerInfoData} = useGet({ - path: `${consts.API.IBC_RELAYERS_DETAIL}/${channelId}`, - }); - - const {data: relayerAssetDaily} = useGet({ - path: `/ibc/channel/${channelId}/daily-transfer-value`, - }); - - const {data: relayerAssetList, loading: assetListLoading, error: assetListError} = useGet({ - path: `/ibc/channel/${channelId}/assets?tx_type=${!assetSearch ? TX_TYPE.RECEIVE : TX_TYPE.TRANSFER}`, - }); - - const onPageChange = page => { - setPageId(page); - }; - - statusCardList = ; - relayerAssets = ; - relayerTransactions = - if (isLargeScreen) { - titleSection = ( - - - - - - ); - } else { - titleSection = ; - } - - if (assetListLoading) { - tableSection = isLargeScreen ? : ; - } else { - if (assetListError) { - totalPagesRef.current = null; - tableSection = ; - } else { - if (!isNaN(relayerAssetList?.length)) { - totalPagesRef.current = relayerAssetList?.length; - } else { - totalPagesRef.current = null; - } - if (relayerAssetList?.length > 0) { - let arrayRelayerAssets = pageId === 1 ? relayerAssetList.slice(0,5) : relayerAssetList.slice((pageId - 1) * 5,((pageId - 1) * 5) + 5); - tableSection = isLargeScreen ? : ; - } else { - tableSection = ; - } - } - } - paginationSection = totalPagesRef.current ? ( - onPageChange(page)} /> - ) : ( - <> - ); - - return ( - <> - {titleSection} - - {statusCardList} - - - {relayerAssets} - - -
- - {tableSection} - {paginationSection} -
-
-
-
- {relayerTransactions} -
-
- - ); -}; - -export default RelayerDetail; diff --git a/src/containers/RelayerDetail/RelayerAsset.module.scss b/src/containers/RelayerDetail/RelayerAsset.module.scss deleted file mode 100644 index 3ee155214..000000000 --- a/src/containers/RelayerDetail/RelayerAsset.module.scss +++ /dev/null @@ -1,11 +0,0 @@ -.chart { - border-radius: 8px; - box-shadow: 0 0.3rem 0.6rem 0 rgba(0, 0, 0, 0.16); - height: 100%; - background: var(--common-containerBackgroundColor); - @media (min-width: 1279px) { - padding-top: calc(130px / 2); - } -} - - diff --git a/src/containers/RelayerDetail/RelayerAssset.js b/src/containers/RelayerDetail/RelayerAssset.js deleted file mode 100644 index dd85a9b3b..000000000 --- a/src/containers/RelayerDetail/RelayerAssset.js +++ /dev/null @@ -1,136 +0,0 @@ -import React from "react"; -import cn from "classnames/bind"; -import HighchartsReact from "highcharts-react-official"; -import Highcharts from "highcharts"; -import { Select } from "antd"; -import "antd/dist/antd.css"; - -// helper -import { ThemeSetup } from "src/helpers/helper"; - -// styles -import styles from "./RelayerAsset.module.scss"; - -// constants -const cx = cn.bind(styles); -const { Option } = Select; -const dataLimit = 5; - -const RelayerAsset = ({relayerAssetDaily}) => { - const dataCategories = relayerAssetDaily && Object.keys(relayerAssetDaily); - const dataReceived = dataCategories?.map(item => relayerAssetDaily[item]?.Receive); - const dataTransfer = dataCategories?.map(item => relayerAssetDaily[item]?.Transfer); - const { isDarkTheme } = ThemeSetup(); - const options = { - chart: { - type: "column", - height: 460, - backgroundColor: isDarkTheme ? "#302737" : "#FFFF", - }, - title: { - text: "Weekly Transferred Value", - style: { - fontSize: "14px", - fontWeight: 1000, - color: isDarkTheme ? "#F6F7FB" : "#181818", - }, - }, - subtitle: { - text: "Resize the frame or click buttons to change appearance", - }, - legend: { - itemStyle: { - color: isDarkTheme ? "#F6F7FB" : "#181818", - }, - }, - xAxis: { - categories: dataCategories, - labels: { - x: -10, - style: { - color: isDarkTheme ? "#F6F7FB" : "#181818", - } - }, - title: { - style: { - color: "red", - }, - }, - }, - credits: { - enabled: false, - }, - - yAxis: { - allowDecimals: false, - title: { - text: "Amount", - }, - labels: { - style: { - color: isDarkTheme ? "#F6F7FB" : "#181818", - } - }, - }, - - - plotOptions: { - column: { - stacking: "normal", - }, - }, - - series: [ - { - name: "Received", - data: dataReceived, - }, - { - name: "Transfer", - data: dataTransfer, - }, - ], - responsive: { - rules: [ - { - condition: { - maxWidth: 280, - }, - chartOptions: { - legend: { - align: "center", - verticalAlign: "bottom", - layout: "horizontal", - }, - yAxis: { - labels: { - align: "left", - x: 0, - y: -5 - }, - title: { - text: null, - }, - }, - subtitle: { - text: null, - }, - credits: { - enabled: false, - }, - }, - }, - ], - }, - }; - - return ( -
-
- -
-
- ); -}; - -export default RelayerAsset; diff --git a/src/containers/RelayerDetail/RelayerDetail.module.scss b/src/containers/RelayerDetail/RelayerDetail.module.scss deleted file mode 100644 index cde3e3bb2..000000000 --- a/src/containers/RelayerDetail/RelayerDetail.module.scss +++ /dev/null @@ -1,76 +0,0 @@ -.relayers { - &-card-list { - min-height: 590px; - margin-bottom: 20px; - } - &-transactions { - padding-top: 10px; - margin-bottom: 50px; - padding: 0; - background: transparent; - box-shadow: none; - - @media screen and (min-width: 1280px) { - padding: 20px; - background: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - } - - &-header { - margin-bottom: 20px; - color: var(--common-textColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - letter-spacing: 0.4px; - } - - &-body { - position: relative; - - .no-result-wrapper { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } - } - &-assets-card { - padding: 0; - background: transparent; - box-shadow: none; - height: 100%; - @media screen and (min-width: 1280px) { - padding: 20px; - background: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - } - - &-header { - margin-bottom: 20px; - color: var(--common-textColor); - font-family: "IBM Plex Sans"; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - letter-spacing: 0.4px; - } - - &-body { - position: relative; - - .no-result-wrapper { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } - } -} diff --git a/src/containers/RelayerDetail/RelayerTransactions.js b/src/containers/RelayerDetail/RelayerTransactions.js deleted file mode 100644 index 979952207..000000000 --- a/src/containers/RelayerDetail/RelayerTransactions.js +++ /dev/null @@ -1,72 +0,0 @@ -import React, {memo, useState, useRef} from "react"; -import {useGet} from "restful-react"; -import classNames from "classnames/bind"; -import {useTheme} from "@material-ui/core/styles"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -import consts from "src/constants/consts"; -import DelegationTable from "src/components/Ibc/DelegationTable"; -import DelegationTableSkeleton from "src/components/Ibc/DelegationTable/DelegationTableSkeleton"; -import DelegationCardList from "src/components/Ibc/DelegationCardList/DelegationCardList"; -import DelegationCardListSkeleton from "src/components/Ibc/DelegationCardList/DelegationCardListSkeleton"; -import Pagination from "src/components/common/Pagination"; -import NoResult from "src/components/common/NoResult"; -import styles from "./RelayerTransactions.module.scss"; - -const cx = classNames.bind(styles); - -const RelayerTransactions = memo(({channelId}) => { - const theme = useTheme(); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const [pageId, setPageId] = useState(1); - const totalPagesRef = useRef(null); - - const onPageChange = page => { - setPageId(page); - }; - - const {data, loading, error} = useGet({ - path: `/ibc/channel/${channelId}/txs?page_id=${pageId}`, - }); - - let tableSection; - let paginationSection; - - if (loading) { - tableSection = isLargeScreen ? : ; - } else { - if (error) { - totalPagesRef.current = null; - tableSection = ; - } else { - if (!isNaN(data?.total)) { - totalPagesRef.current = data.total; - } else { - totalPagesRef.current = null; - } - - if (Array.isArray(data?.data) && data.data.length > 0) { - tableSection = isLargeScreen ? : ; - } else { - tableSection = ; - } - } - } - - paginationSection = totalPagesRef.current ? ( - onPageChange(page)} /> - ) : ( - <> - ); - - return ( -
-
Transactions
-
- {tableSection} - {paginationSection} -
-
- ); -}); - -export default RelayerTransactions; diff --git a/src/containers/RelayerDetail/RelayerTransactions.module.scss b/src/containers/RelayerDetail/RelayerTransactions.module.scss deleted file mode 100644 index 390f1b4e0..000000000 --- a/src/containers/RelayerDetail/RelayerTransactions.module.scss +++ /dev/null @@ -1,34 +0,0 @@ -@import "src/styles/utils"; - -.delegation-card { - padding: 0; - background: transparent; - box-shadow: none; - height: 100%; - @media screen and (min-width: 1280px) { - background: var(--common-containerBackgroundColor); - box-shadow: 0px 2px 8px var(--common-boxShadowColor); - border-radius: 8px; - } - - &-header { - margin-bottom: 20px; - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; - font-style: normal; - font-weight: 500; - font-size: 20px; - line-height: 150%; - letter-spacing: 0.4px; - } - - &-body { - position: relative; - .no-result-wrapper { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } -} diff --git a/src/containers/RelayerDetail/index.js b/src/containers/RelayerDetail/index.js deleted file mode 100644 index 167ab8858..000000000 --- a/src/containers/RelayerDetail/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import Relayer from "./Relayer"; - -export default Relayer; diff --git a/src/containers/Relayers/Channel.module.scss b/src/containers/Relayers/Channel.module.scss deleted file mode 100644 index fa17d9dec..000000000 --- a/src/containers/Relayers/Channel.module.scss +++ /dev/null @@ -1,81 +0,0 @@ -.channel-list-wrapper { - padding: 10px; - - .body-list { - border: 1px solid #e6e6e6; - margin-top: 10px; - padding: 5px 0; - color: var(--common-textColor); - border-radius: 8px; - align-items: center; - display: flex; - } - - .body-list.mobile { - border: 1px solid #e6e6e6; - padding: 10px; - } - - .channel-name { - background: var(--common-backGroundColorGray); - border-radius: 8px; - padding: 8px; - } - - .line-wrapper { - width: 100px; - height: 2px; - margin: 18px -40px; - z-index: 1; - } - - .line-wrapper.mobile { - width: 64px; - height: 2px; - margin: -34px -26px; - z-index: 1; - } - - .dot { - border-radius: 50%; - display: inline-block; - width: 10px; - height: 10px; - } - - .flexCenter { - display: flex; - align-items: center; - justify-content: space-between; - } - - .channel-name.partners { - display: flex; - align-items: center; - - .dot { - margin-right: 10px; - } - } - - .pagination { - display: flex; - flex-direction: row-reverse; - margin-top: 15px; - } - - .logo-icon { - color: var(--common-textColor); - height: 24px; - width: 24px; - } -} - -:global(.ant-collapse-icon-position-right > .ant-collapse-item > .ant-collapse-header .ant-collapse-arrow) { - top: 50%; - color: var(--common-textColor); -} - -.fontSize12 { - font-size: 10px; -} diff --git a/src/containers/Relayers/ChannelList.js b/src/containers/Relayers/ChannelList.js deleted file mode 100644 index a8d831930..000000000 --- a/src/containers/Relayers/ChannelList.js +++ /dev/null @@ -1,205 +0,0 @@ -import React, {useMemo, useState} from "react"; -import cn from "classnames/bind"; -import moment from "moment"; -import Row from "antd/lib/row"; -import Col from "antd/lib/col"; -import Space from "antd/lib/space"; -import Avatar from "antd/lib/avatar/avatar"; -import {useHistory} from "react-router-dom"; -import {useTheme} from "@material-ui/core/styles"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; - -// constant -import {STATUS_COLOR, STATE} from "./constants"; - -// components -import Pagination from "src/components/common/Pagination"; - -// logo -import OraiLogoLight from "src/assets/header/logo.svg"; -import OraiLogoDark from "src/assets/header/logo.svg"; - -import OraiIcon from "src/icons/OraiIcon"; - -// styles -import styles from "./Channel.module.scss"; - -const cx = cn.bind(styles); - -const dataLimit = 5; - -const ChannelList = ({channels, channelName, image}) => { - const theme = useTheme(); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const [currentPage, setCurrentPage] = useState(1); - const history = useHistory(); - const totalPages = Math.ceil(channels?.length / dataLimit); - - const onChangePage = page => { - setCurrentPage(page); - }; - - const getPaginatedData = () => { - const startIndex = currentPage * dataLimit - dataLimit; - const endIndex = startIndex + dataLimit; - return channels.slice(startIndex, endIndex); - }; - - const listChannels = getPaginatedData(); - - const renderHeaderChannels = useMemo(() => { - return ( - - -
#
- - -
- - } /> - Oraichain - -
- - - -
- - - {channelName} - -
- - - - - -
Operating Period
- - -
24h Txs
- - -
Value
- -
- ); - }, [channelName]); - - const redirectRelayerDetail = (channelId, status) => { - if (status === STATE.STATE_CLOSED) return; - - return history.push(`/ibc/relayers/${channelId}`); - }; - - const renderChannels = useMemo(() => { - const renderChannelItem = (item, index) => { - var createdAt = moment(item?.channel?.created_at, "YYYY-MM-DD"); - const currentDate = moment().startOf("day"); - const operatingPeriod = moment.duration(currentDate.diff(createdAt)).asDays(); - - return ( - redirectRelayerDetail(item?.channel?.channel_id, item?.channel?.status)}> - -
{index + 1}
- - -
-
{item?.channel?.channel_id}
- -
- - -
- - -
- -
{item?.channel?.counterparty_channel_id}
-
- - - - - -
- {operatingPeriod} {operatingPeriod > 1 ? "Days" : "Day"} -
- - -
{item?.total_txs_within_24h}
- - -
$ {item?.total_value_within_24h?.toFixed(2)}
- - - ); - }; - - const renderChangeItemMobile = (item, index) => { - var createdAt = moment(item?.channel?.created_at, "YYYY-MM-DD"); - const currentDate = moment().startOf("day"); - const operatingPeriod = moment.duration(currentDate.diff(createdAt)).asDays(); - return ( - redirectRelayerDetail(item?.channel?.channel_id, item?.channel?.status)}> - -
-
-
-
Oraichain
-
{item?.channel?.channel_id}
-
- -
-
Operating Period
-
24h Txs
-
Value
-
- - - -
- - - -
-
- -
-
{channelName}
-
{item?.channel?.counterparty_channel_id}
-
-
-
- {operatingPeriod} {operatingPeriod > 1 ? "Days" : "Day"} -
-
{item?.total_txs_within_24h}
-
$ {item?.total_value_within_24h?.toFixed(2)}
-
- - - ); - }; - - return listChannels.map((item, index) => (isLargeScreen ? renderChannelItem(item, index) : renderChangeItemMobile(item, index))); - }, [listChannels, isLargeScreen]); - - return ( -
- {isLargeScreen && renderHeaderChannels} - {renderChannels} -
- {totalPages > 1 && onChangePage(page)} />} -
-
- ); -}; - -export default ChannelList; diff --git a/src/containers/Relayers/Relayers.module.scss b/src/containers/Relayers/Relayers.module.scss deleted file mode 100644 index b339e70d0..000000000 --- a/src/containers/Relayers/Relayers.module.scss +++ /dev/null @@ -1,76 +0,0 @@ -@import "src/styles/utils"; - -.relayers { - .page-title { - margin-bottom: 10px; - - h1 { - text-transform: uppercase; - font-size: 24px; - font-weight: 500; - color: var(--common-textColor); - } - } - - .item-list { - margin-bottom: 10px; - border: unset; - box-shadow: 0 0.3rem 0.6rem 0 rgba(0, 0, 0, 0.16); - border-radius: 8px; - } - - .extra-list { - display: flex; - flex-direction: column; - align-items: center; - - &-info { - color: #89909b; - margin-top: 6px; - } - } - - .dot { - border-radius: 50%; - display: inline-block; - width: 10px; - height: 10px; - margin-right: 5px; - } - - .extra-list-tag { - border-radius: 160px; - font-weight: 500; - padding: 5px 10px; - display: flex; - align-items: center; - justify-content: space-between; - } - - :global(h4.ant-list-item-meta-title) { - font-size: 16px; - font-weight: 500; - text-transform: uppercase; - color: var(--common-textColor); - } - - :global(.ant-list-item-meta-description) { - color: var(--common-textColor); - } - - :global(.ant-collapse > .ant-collapse-item) { - border-bottom: unset; - } - - :global(.ant-collapse) { - background-color: var(--common-containerBackgroundColor); - } - - :global(.ant-collapse-content) { - background: var(--common-containerBackgroundColor); - } - - :global(.ant-collapse-content) { - color: var(--common-textColor); - } -} diff --git a/src/containers/Relayers/constants.js b/src/containers/Relayers/constants.js deleted file mode 100644 index 7442e7d5d..000000000 --- a/src/containers/Relayers/constants.js +++ /dev/null @@ -1,13 +0,0 @@ -export const STATE = { - STATE_UNINITIALIZED_UNSPECIFIED: "STATE_UNINITIALIZED_UNSPECIFIED", - STATE_INIT: "STATE_INIT", - STATE_TRYOPEN: "STATE_TRYOPEN", - STATE_OPEN: "STATE_OPEN", - STATE_CLOSED: "STATE_CLOSED", -}; - -export const STATUS_COLOR = { - [STATE.STATE_OPEN]: "#37cc6e", - [STATE.STATE_CLOSED]: "#ff2745", - [STATE.STATE_INIT || STATE.STATE_TRYOPEN || STATE.STATE_UNINITIALIZED_UNSPECIFIED]: "#ffb323", -}; diff --git a/src/containers/Relayers/index.js b/src/containers/Relayers/index.js deleted file mode 100644 index d993250de..000000000 --- a/src/containers/Relayers/index.js +++ /dev/null @@ -1,96 +0,0 @@ -import React, { useMemo } from "react"; -import cn from "classnames/bind"; -import { useGet } from "restful-react"; -import List from "antd/lib/list"; -import Avatar from "antd/lib/avatar"; -import Collapse from "antd/lib/collapse"; -import Container from "@material-ui/core/Container"; -import useMediaQuery from "@material-ui/core/useMediaQuery"; -// components -import ChannelList from "./ChannelList"; -import { useTheme } from "@material-ui/core/styles"; -import TogglePageBar from "src/components/common/TogglePageBar"; -import PageTitle from "src/components/common/PageTitle"; -import TitleWrapper from "src/components/common/TitleWrapper"; - -// constants -import { STATUS_COLOR, STATE } from "./constants"; -import consts from "src/constants/consts"; - -// styles -import styles from "./Relayers.module.scss"; - -const cx = cn.bind(styles); -const { Panel } = Collapse; - -const Relayers = () => { - const theme = useTheme(); - const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const { data } = useGet({ - path: consts.API.IBC_RELAYERS, - }); - - let titleSection; - titleSection = isLargeScreen ? ( - - - - {/* */} - - - ) : ( - - ); - - const dataSource = data && Object.keys(data)?.map(e => { - return { - chainId: e, - ...data[e], - } - }) - - const renderList = useMemo(() => { - const genHeader = item => { - const listStatus = item?.channels?.map(i => i?.channel?.status); - const atLeastOpenStatus = listStatus.some(item => item != STATE.STATE_CLOSED); - const listOpenStatus = item?.channels?.filter(i => i?.channel?.status == STATE.STATE_OPEN); - const colorStatus = atLeastOpenStatus ? STATUS_COLOR[STATE.STATE_OPEN] : STATUS_COLOR[STATE.STATE_CLOSED]; - const backgroundStatus = atLeastOpenStatus ? "rgba(55,204,110,.1)" : "rgba(255,39,69,.1)"; - return ( - - } title={item.name || item.chainId || "UNKNOWN"} description={item?.denom || item?.channels?.[0]?.channel?.channel_id || "unknown"} /> -
-
- -
{atLeastOpenStatus ? "Opened" : "Closed"}
-
-
Channel {`${listOpenStatus?.length}/${listStatus?.length}`}
-
-
- ); - }; - - const renderItem = item => { - return ( - - - - - - ); - }; - - return dataSource?.map(item => renderItem(item)); - }, [dataSource]); - - return ( - <> - {titleSection} - - {renderList} - - - ); -}; - -export default Relayers; diff --git a/src/containers/Router/Router.js b/src/containers/Router/Router.js index a5bcb186a..2a11273c6 100644 --- a/src/containers/Router/Router.js +++ b/src/containers/Router/Router.js @@ -22,7 +22,6 @@ const Tx = lazy(() => import(`src/containers/Tx`)); const NotFound = lazy(() => import(`src/containers/NotFound`)); const Account = lazy(() => import(`src/containers/Account`)); const DataSources = lazy(() => import(`src/containers/DataSources`)); -const Ibc = lazy(() => import(`src/containers/Ibc`)); const DataSourcesDetail = lazy(() => import(`src/containers/DataSourcesDetail`)); const TestCases = lazy(() => import(`src/containers/TestCases`)); const OracleScripts = lazy(() => import(`src/containers/OracleScripts`)); @@ -37,15 +36,11 @@ const Requests = lazy(() => import(`src/containers/Requests`)); const RequestReportDetail = lazy(() => import(`src/containers/RequestReportDetail`)); const RequestDetails = lazy(() => import(`src/containers/RequestDetails`)); const Wallet = lazy(() => import(`src/containers/Wallet`)); -const PriceFeeds = lazy(() => import(`src/containers/PriceFeeds`)); const Randomness = lazy(() => import(`src/components/Randomness`)); const RandomnessDetail = lazy(() => import(`src/components/Randomness/RandomnessDetail`)); const OracleRequestDetail = lazy(() => import(`src/containers/OracleRequestDetail`)); const OracleReportDetail = lazy(() => import(`src/containers/OracleReportDetail`)); const ExportData = lazy(() => import(`src/containers/ExportData`)); -const Relayers = lazy(() => import(`src/containers/Relayers`)); -const RelayerDetail = lazy(() => import(`src/containers/RelayerDetail`)); -const OracleAI = lazy(() => import(`src/containers/OracleAI`)); const WasmCodeDetail = lazy(() => import(`src/containers/WasmCode`)); export default function(props) { @@ -67,19 +62,15 @@ export default function(props) { - - - - @@ -87,8 +78,6 @@ export default function(props) { - - } /> diff --git a/src/containers/Tabs/Tabs.css b/src/containers/Tabs/Tabs.css index 5d93825f3..8f484e6b0 100644 --- a/src/containers/Tabs/Tabs.css +++ b/src/containers/Tabs/Tabs.css @@ -87,9 +87,6 @@ .dropdown-trans { transform: translate(-103%, 333%) !important; } - .dropdown-ibc { - transform: translate(-103%, 430%) !important; - } .dropdown-validators { transform: translate(-103%, 185%) !important; } @@ -99,9 +96,6 @@ .dropdown-smart { transform: translate(-103%, 530%) !important; } - .dropdown-sub { - transform: translate(-103%, 233%) !important; - } } .dropdown-proposals .MuiButtonBase-root { diff --git a/src/containers/Tabs/Tabs.js b/src/containers/Tabs/Tabs.js index 0b3c55b61..5200b7ff9 100644 --- a/src/containers/Tabs/Tabs.js +++ b/src/containers/Tabs/Tabs.js @@ -19,10 +19,7 @@ import DashBoardTabIcon from "src/icons/Tabs/DashBoardTabIcon"; import ProposalsTabIcon from "src/icons/Tabs/ProposalsTabIcon"; import PriceFeedsTabIcon from "src/icons/Tabs/PriceFeedsTabIcon"; import ValidatorsTabIcon from "src/icons/Tabs/ValidatorsTabIcon"; -import TestCaseTabIcon from "src/icons/Tabs/TestCaseTabIcon"; -import RequestsTabIcon from "src/icons/Tabs/RequestsTabIcon"; import TransactionsTabIcon from "src/icons/Tabs/TransactionsTabIcon"; -import IbcTabIcon from "src/icons/Tabs/IbcTabIcon"; import backIcon from "src/assets/header/back_ic.svg"; // functions and components @@ -48,16 +45,11 @@ const Tabs = memo(() => { const [openTransactions, setOpenTransactions] = React.useState(false); const [openProposals, setOpenProposals] = React.useState(false); const [openOracleScripts, setOpenOracleScripts] = React.useState(false); - const [openRequests, setOpenRequests] = React.useState(false); const [openOthers, setOpenOthers] = React.useState(false); - const [openIbc, setOpenIbc] = React.useState(false); const validatorsAnchorRef = React.useRef(null); const transactionsAnchorRef = React.useRef(null); const proposalsAnchorRef = React.useRef(null); const oracleScriptsAnchorRef = React.useRef(null); - const requestsAnchorRef = React.useRef(null); - const othersAnchorRef = React.useRef(null); - const ibcAnchorRef = React.useRef(null); const handleOpenValidators = () => { setOpenValidators(true); @@ -91,14 +83,6 @@ const Tabs = memo(() => { setOpenOracleScripts(false); }; - const handleOpenRequests = () => { - setOpenRequests(true); - }; - - const handleCloseRequests = () => { - setOpenRequests(false); - }; - const handleOpenOthers = () => { setOpenOthers(true); }; @@ -107,14 +91,6 @@ const Tabs = memo(() => { setOpenOthers(false); }; - const handleOpenIbc = () => { - setOpenIbc(true); - }; - - const handleCloseIbc = () => { - setOpenIbc(false); - }; - const renderTabDropdownComponent = ({classNameDropdown, childs, anchorRef, handleOpen, handleClose, open, name, route, img, index, dropdownClassName}) => (