diff --git a/src/components/Account/TransactionCard/TransactionCard.js b/src/components/Account/TransactionCard/TransactionCard.js index 5fcd2b6b..43fc7290 100644 --- a/src/components/Account/TransactionCard/TransactionCard.js +++ b/src/components/Account/TransactionCard/TransactionCard.js @@ -50,7 +50,7 @@ const TransactionCard = memo(({ account = "", royalty = false }) => { tableSection = isLargeScreen ? : ; } else { if (error) { - totalPagesRef.current = null; + totalPagesRef.current = null; tableSection = ; } else { if (!isNaN(data?.page?.total_page)) { diff --git a/src/components/TxList/Tabs/Tabs.js b/src/components/TxList/Tabs/Tabs.js index e5e43e3c..aea0439b 100644 --- a/src/components/TxList/Tabs/Tabs.js +++ b/src/components/TxList/Tabs/Tabs.js @@ -25,6 +25,12 @@ export default function({activeTab, setActiveTab, address, isTab = false}) {
Royalty Transactions
)} + {!isTab && ( +
setActiveTab(3)}> + +
CW-721 Transactions
+
+ )} {dataRes?.data && dataRes?.data?.length > 0 && (
setActiveTab(2)}> diff --git a/src/components/TxList/Tabs/Tabs.module.scss b/src/components/TxList/Tabs/Tabs.module.scss index 46e073e2..a1ef14c2 100644 --- a/src/components/TxList/Tabs/Tabs.module.scss +++ b/src/components/TxList/Tabs/Tabs.module.scss @@ -14,7 +14,7 @@ -ms-overflow-style: none; /* IE and Edge */ scrollbar-width: none; /* Firefox */ - @media (min-width: 600px) { + @media (min-width: 600px) { display: inline-flex; border-radius: 8px; border: 1px solid var(--common-borderColor); diff --git a/src/components/Wallet/NFTToken/NFTCard/NFTCard.js b/src/components/Wallet/NFTToken/NFTCard/NFTCard.js index fa5de715..99b29b32 100644 --- a/src/components/Wallet/NFTToken/NFTCard/NFTCard.js +++ b/src/components/Wallet/NFTToken/NFTCard/NFTCard.js @@ -42,34 +42,45 @@ const NFTCard = memo(({ data = [], address }) => { {reduceStringAdress("TxHash", item?.tx_hash, `${consts.PATH.TXLIST}/${item.tx_hash}`)} + + {reduceStringAdress("Owner", item?.owner, `${consts.PATH.TXLIST}/${item.owner}`)} {reduceStringAdress("Creator", item?.creator, `${consts.PATH.TXLIST}/${item.creator}`)} - {reduceStringAdress("Contract address", item?.contract_address, `${consts.PATH.TXLIST}/${item.contract_address}`)} - {reduceStringAdress("Contract", item?.contract, `${consts.PATH.TXLIST}/${item.contract}`)} - + {/* {reduceStringAdress("Contract address", item?.contract_address, `${consts.PATH.TXLIST}/${item.contract_address}`)} */} + {/* {reduceStringAdress("Contract", item?.contract, `${consts.PATH.TXLIST}/${item.contract}`)} */} + + + +
-
NFT ID
+
Name
- {item?.nft_id} + {item?.nft_name}
-
NFT Name
+
Type
- {item?.nft_name} + + {item.creator_type} +
-
Creator Type
+
Token ID
- {item?.creator_type.toUpperCase()} + {item?.nft_id}
+
Description
+
+ {item?.description} +
Time
diff --git a/src/components/Wallet/NFTToken/NFTCard/NFTCard.module.scss b/src/components/Wallet/NFTToken/NFTCard/NFTCard.module.scss index ccd9ffa0..40126dd0 100644 --- a/src/components/Wallet/NFTToken/NFTCard/NFTCard.module.scss +++ b/src/components/Wallet/NFTToken/NFTCard/NFTCard.module.scss @@ -28,7 +28,7 @@ .item-title { color: var(--common-textColor); - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-size: 16px; @@ -37,16 +37,48 @@ .item-text { color: var(--common-textColor); - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 16px; line-height: 150%; } + .type-data-cell { + display: flex; + flex-direction: row; + justify-content: end; + align-items: right; + + .first-message-type { + padding: 6px 10px; + margin-right: 5px; + text-transform: uppercase; + 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-family: "IBM Plex Sans"; + font-style: normal; + font-weight: normal; + font-size: 12px; + line-height: 150%; + } + + .number-of-message { + color: var(--common-textColor); + font-family: "IBM Plex Sans"; + font-style: normal; + font-weight: normal; + font-size: 12px; + line-height: 150%; + } + } + .item-link { - color: var(--common-linkColor); - font-family: 'IBM Plex Sans'; + color: var(--common-linkColor); + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 16px; @@ -69,7 +101,7 @@ .address { color: var(--common-linkColor); - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 16px; diff --git a/src/components/Wallet/NFTToken/NFTCard/NFTCardSkeleton.js b/src/components/Wallet/NFTToken/NFTCard/NFTCardSkeleton.js index 7ae70a07..1d6f0181 100644 --- a/src/components/Wallet/NFTToken/NFTCard/NFTCardSkeleton.js +++ b/src/components/Wallet/NFTToken/NFTCard/NFTCardSkeleton.js @@ -3,44 +3,102 @@ import Skeleton from "@material-ui/lab/Skeleton"; import classNames from "classnames/bind"; import styles from "./NFTCard.module.scss"; -const CwCardSkeleton = memo(({ rows = 10 }) => { +const NFTCardSkeleton = memo(({ rows = 20 }) => { const cx = classNames.bind(styles); - let CwCardSkeletonItems = []; - const dataSource = [ - { title: "TxHash" }, - { title: "NFT ID" }, - { title: "NFT Name" }, - { title: "Creator Type" }, - { title: "Creator" }, - { title: "Contract address" }, - { title: "Contract" }, - { title: "Time" }, - ]; + let NFTCardSkeletonItems = []; for (let i = 1; i <= rows; i++) { - CwCardSkeletonItems.push( -
+ NFTCardSkeletonItems.push( +
- {dataSource.map(({ title }) => { - return ( - - - - - )})} - + + + + + + + + + + + + + + + + + + + + + + + + + {/* + + + + + + + */} + + + + + + + +
-
{title}
-
- -
+
TxHash
+
+ +
+
Name
+
+ +
+
Type
+
+ +
+
Owner
+
+ +
+
Token ID
+
+ +
+
Creator
+
+ +
+
Contract address
+
+ +
+
Contract
+
+ +
+
Description
+
+ +
+
Time
+
+ +
); } - return
{CwCardSkeletonItems}
; + return
{NFTCardSkeletonItems}
; }); -export default CwCardSkeleton; +export default NFTCardSkeleton; diff --git a/src/components/Wallet/NFTToken/NFTTable/NFTTable.js b/src/components/Wallet/NFTToken/NFTTable/NFTTable.js index 52394c88..4e10cd8e 100644 --- a/src/components/Wallet/NFTToken/NFTTable/NFTTable.js +++ b/src/components/Wallet/NFTToken/NFTTable/NFTTable.js @@ -13,33 +13,39 @@ const cx = classNames.bind(styles); export const getHeaderRow = () => { const txHashHeaderCell =
TxHash
; - const contractAddrHeaderCell =
Contract address
; - const contractHeaderCell =
Contract
; + // const contractAddrHeaderCell =
Contract address
; + // const contractHeaderCell =
Contract
; const creatorHeaderCell =
Creator
; - const creatorTypeHeaderCell =
Creator Type
; - const nftNameHeaderCell =
NFT Name
; - const nftIDHeaderCell =
NFT ID
; - const timeHeaderCell =
Time
; + const creatorTypeHeaderCell =
Type
; + const nftNameHeaderCell =
Name
; + const nftIDHeaderCell =
Token ID
; + const timeHeaderCell =
Time
; + const ownerHeaderCell =
Owner
; + const descriptionHeaderCell =
Description
; let headerCells = [ txHashHeaderCell, - nftIDHeaderCell, nftNameHeaderCell, creatorTypeHeaderCell, + ownerHeaderCell, + nftIDHeaderCell, creatorHeaderCell, - contractAddrHeaderCell, - contractHeaderCell, + // contractAddrHeaderCell, + // contractHeaderCell, + descriptionHeaderCell, timeHeaderCell, ]; let headerCellStyles = [ - { width: "14%", minWidth: "180px" }, // TxHash - { width: "8%", minWidth: "80px" }, // NFT ID - { width: "14%", minWidth: "120px" }, // NFT Name - { width: "12%", minWidth: "120px" }, // Creator type - { width: "14%", minWidth: "180px" }, // Creator - { width: "14%", minWidth: "180px" }, // Contract address - { width: "14%", minWidth: "180px" }, // Contract - { width: "12%", minWidth: "120px" }, // Time + { width: "14%", minWidth: "120px" }, // TxHash + { width: "14%", minWidth: "120px" }, // Name + { width: "8%", minWidth: "80px" }, // Type + { width: "12%", minWidth: "120px" }, //Owner + { width: "8%", minWidth: "80px" }, // Token ID + { width: "12%", minWidth: "120px" }, // Creator + // { width: "12%", minWidth: "120px" }, // Contract address + // { width: "12%", minWidth: "120px" }, // Contract + { width: "12%", minWidth: "120px" }, // Description + { width: "8%", minWidth: "80px" }, // time ]; return { @@ -59,6 +65,17 @@ const reduceStringAdress = (value, toHref = "", isStyle, rawString = false) => { return result; }; +const reduceStringDes = (value, isStyle, rawString = false) => { + const result = _.isNil(value) ? ( +
-
+ ) : ( +
+ {isStyle === 1 ?
{rawString ? value : reduceString(value, 6, 6)}
: rawString ? value : reduceString(value, 6, 6)} +
+ ); + return result; +}; + const NFTTable = memo(({ data = [], address }) => { const getDataRows = data => { if (!Array.isArray(data)) { @@ -67,16 +84,17 @@ const NFTTable = memo(({ data = [], address }) => { return data.map(item => { const txHashDataCell = reduceStringAdress(item?.tx_hash, `${consts.PATH.TXLIST}/${item.tx_hash}`); - - const contractAddrDataCell = reduceStringAdress(item?.contract_address, `${consts.PATH.ACCOUNT}/${item?.contract_address}`); - const contractDataCell = reduceStringAdress(item?.contract, `${consts.PATH.ACCOUNT}/${item?.contract}`); + // const contractAddrDataCell = reduceStringAdress(item?.contract_address, `${consts.PATH.ACCOUNT}/${item?.contract_address}`); + // const contractDataCell = reduceStringAdress(item?.contract, `${consts.PATH.ACCOUNT}/${item?.contract}`); const creatorDataCell = reduceStringAdress(item?.creator, `${consts.PATH.ACCOUNT}/${item?.creator}`); + const ownerDataCell = reduceStringAdress(item?.owner, `${consts.PATH.ACCOUNT}/${item?.owner}`); + const descriptionDataCell = reduceStringDes(item?.description, `${consts.PATH.ACCOUNT}/${item?.description}`); const creatorTypeDataCell = _.isNil(item?.creator_type) ? ( -
-
+
-
) : ( -
- {item.creator_type.toUpperCase()} +
+
{item.creator_type}
); @@ -99,10 +117,21 @@ const NFTTable = memo(({ data = [], address }) => { const timeDataCell = _.isNil(item?.timestamp) ? (
-
) : ( -
{setAgoTime(item.timestamp)}
+
{setAgoTime(item.timestamp)}
); - return [txHashDataCell, nftIDDataCell, nftNameDataCell, creatorTypeDataCell, creatorDataCell, contractAddrDataCell, contractDataCell, timeDataCell]; + return [ + txHashDataCell, + nftNameDataCell, + creatorTypeDataCell, + ownerDataCell, + nftIDDataCell, + creatorDataCell, + // contractAddrDataCell, + // contractDataCell, + descriptionDataCell, + timeDataCell, + ]; }); }; diff --git a/src/components/Wallet/NFTToken/NFTTable/NFTTable.module.scss b/src/components/Wallet/NFTToken/NFTTable/NFTTable.module.scss index a0612e27..0f2dbe96 100644 --- a/src/components/Wallet/NFTToken/NFTTable/NFTTable.module.scss +++ b/src/components/Wallet/NFTToken/NFTTable/NFTTable.module.scss @@ -12,8 +12,8 @@ } .header-cell { - color: var(--common-textColor); - font-family: 'IBM Plex Sans'; + color: var(--common-textColor); + font-family: "IBM Plex Sans"; font-style: normal; font-weight: bold; font-size: 14px; @@ -27,7 +27,7 @@ .sm-contract-data-cell { color: var(--common-linkColor); - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 14px; @@ -45,9 +45,10 @@ margin-right: 5px; border: 1px solid #5f51ff; box-sizing: border-box; + text-transform: uppercase; border-radius: 4px; color: #5f51ff; - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 12px; @@ -56,7 +57,7 @@ .number-of-message { color: #5f51ff; - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 12px; @@ -106,12 +107,42 @@ .height-data-cell { display: block; color: var(--common-textColor); - font-family: 'IBM Plex Sans'; + font-family: "IBM Plex Sans"; font-style: normal; font-weight: normal; font-size: 14px; line-height: 150%; } +.type-data-cell { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + + .first-message-type { + 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-family: "IBM Plex Sans"; + font-style: normal; + font-weight: normal; + font-size: 12px; + line-height: 150%; + } + + .number-of-message { + color: var(--common-textColor); + font-family: "IBM Plex Sans"; + font-style: normal; + font-weight: normal; + font-size: 12px; + line-height: 150%; + } +} .transfer-status { display: block; diff --git a/src/components/Wallet/NFTToken/NFTTable/NFTTableSkeleton.js b/src/components/Wallet/NFTToken/NFTTable/NFTTableSkeleton.js index 1ac0c305..0377d14b 100644 --- a/src/components/Wallet/NFTToken/NFTTable/NFTTableSkeleton.js +++ b/src/components/Wallet/NFTToken/NFTTable/NFTTableSkeleton.js @@ -17,41 +17,56 @@ const NFTTableSkeleton = memo(({rows = 10}) => {
); - const ageDataCell = ( + const nftIDDataCell = (
); - const fromDataCell = ( + const nftNameDataCell = (
); - const statusDataCell = ( + const creatorTypeDataCell = (
); - const toDataCell = ( + const creatorDataCell = (
); - const valueDataCell = ( + // const contractAddrDataCell = ( + //
+ // + //
+ // ); + // const contractDataCell = ( + //
+ // + //
+ // ); + const timeDataCell = (
); - const tokenDataCell = ( + const ownerDataCell = (
); - dataRows.push([txHashDataCell, ageDataCell, fromDataCell, statusDataCell, toDataCell, valueDataCell, tokenDataCell]); + const descriptionDataCell = ( +
+ +
+ ); + dataRows.push([txHashDataCell, nftIDDataCell, nftNameDataCell, creatorTypeDataCell, ownerDataCell, creatorDataCell, timeDataCell, descriptionDataCell]); } return dataRows; }; diff --git a/src/components/Wallet/NFTToken/NFTToken.js b/src/components/Wallet/NFTToken/NFTToken.js index fad18515..f67ed4f9 100644 --- a/src/components/Wallet/NFTToken/NFTToken.js +++ b/src/components/Wallet/NFTToken/NFTToken.js @@ -1,4 +1,4 @@ -import React, { memo, useEffect, useState } from "react"; +import React, { memo, useState, useRef } from "react"; import { useGet } from "restful-react"; import { useTheme } from "@material-ui/core/styles"; import useMediaQuery from "@material-ui/core/useMediaQuery"; @@ -8,80 +8,59 @@ import NoResult from "src/components/common/NoResult"; import NFTTable from "./NFTTable"; import NFTTableSkeleton from "./NFTTable/NFTTableSkeleton"; import NFTCardSkeleton from "./NFTCard/NFTCardSkeleton"; -import { getListNFTToken, getListOWContract } from "src/lib/api"; +import { getListNFTToken } from "src/lib/api"; import NFTCard from "./NFTCard"; import styles from "./NFTToken.module.scss"; -import { NavLink } from "react-router-dom"; import consts from "src/constants/consts"; -import { typeExport } from "src/containers/Account/Account"; const cx = classNames.bind(styles); -const NFTToken = memo(({ account = "", address = "", isOw20 = false }) => { +const NFTToken = memo(({ address = "" }) => { const theme = useTheme(); const isLargeScreen = useMediaQuery(theme.breakpoints.up("lg")); - const [dataCw, setDataCw] = useState({ - data: [], - page: { - limit: 10, - page_id: 1, - }, - }); - const { data, page } = dataCw; - const [path, setPath] = useState(() => { - if (!isOw20) { - return getListNFTToken(address, page); - } - return getListOWContract(address, page); - }); + const [pageId, setPageId] = useState(1); + const totalPagesRef = useRef(null); + + const onPageChange = page => { + setPageId(page); + }; - const { data: dataRes } = useGet({ + const limit = 10; + const path = `${consts.API_BASE}${consts.API.NFT_TXS}/${address}?limit=${limit}&page_id=${pageId} `; + const { data, loading, error } = useGet({ path, }); - useEffect(() => { - if (dataRes) { - setDataCw({ - ...dataCw, - data: dataRes?.data, - page: { - ...dataCw.page, - ...dataRes?.page, - }, - }); - } - }, [dataRes]); + let tableSection; + let paginationSection; - const totalPages = page?.total_page ?? 0; - const currentPage = page?.page_id ?? 1; + 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; + } - const onPageChange = newPage => { - const pageObj = { - ...page, - page_id: newPage, - }; - if (!isOw20) { - return setPath(getListNFTToken(address, pageObj)); + if (Array.isArray(data?.data) && data.data.length > 0) { + tableSection = isLargeScreen ? : ; + } else { + tableSection = ; + } } - return setPath(getListOWContract(address, pageObj)); - }; + } - const tableSekeleton = () => { - return isLargeScreen ? : ; - }; + paginationSection = totalPagesRef.current ? onPageChange(page)} /> : <>; return ( -
- {!dataRes ? ( - tableSekeleton() - ) : Array.isArray(data) && data.length > 0 ? ( - <> - {isLargeScreen ? : } - {totalPages > 0 && onPageChange(page)} />} - - ) : ( - - )} +
+ {tableSection} + {paginationSection}
); }); diff --git a/src/components/Wallet/NFTToken/NFTToken.module.scss b/src/components/Wallet/NFTToken/NFTToken.module.scss index b234ff64..339ac36d 100644 --- a/src/components/Wallet/NFTToken/NFTToken.module.scss +++ b/src/components/Wallet/NFTToken/NFTToken.module.scss @@ -1,4 +1,4 @@ -.cw20 { +.nft { overflow-x: auto; width: 100%; diff --git a/src/components/Wallet/Tabs/Tabs.js b/src/components/Wallet/Tabs/Tabs.js index ed0a8d5b..3a2b117e 100644 --- a/src/components/Wallet/Tabs/Tabs.js +++ b/src/components/Wallet/Tabs/Tabs.js @@ -27,11 +27,11 @@ export default function({ activeTab, setActiveTab, isBecomeValidator, address })
CW-20 Token Txs
)} - {/* {dataRes && dataRes?.length > 0 && ( + {dataRes && dataRes?.length > 0 && (
setActiveTab(7)}> -
NFT Txs
+
CW-721 Transactions
- )} */} + )} {isBecomeValidator && (
setActiveTab(3)}> diff --git a/src/components/Wallet/Tabs/Tabs.module.scss b/src/components/Wallet/Tabs/Tabs.module.scss index 46e073e2..6c4649a1 100644 --- a/src/components/Wallet/Tabs/Tabs.module.scss +++ b/src/components/Wallet/Tabs/Tabs.module.scss @@ -15,7 +15,7 @@ scrollbar-width: none; /* Firefox */ @media (min-width: 600px) { - display: inline-flex; + display: inline-flex; border-radius: 8px; border: 1px solid var(--common-borderColor); } diff --git a/src/constants/consts.js b/src/constants/consts.js index 81d221ed..9eb380b7 100644 --- a/src/constants/consts.js +++ b/src/constants/consts.js @@ -121,11 +121,12 @@ export default Object.freeze({ UPLOAD_IMAGES_VALIDATORS: "/validator/update-image", GET_IMAGES_VALIDATORS: "/validator-detail", OW20_SMART_CONTRACTS: "/ow20_smart_contracts", + NFT_TXS: "/nft_transaction", OW20_CONTRACT: "/ow20_contract", OW20_TOKEN: "/ow20_tokens", WASM_CODE: "/wasm_code", WASM_CODE_BY_ID: "/smart_contracts_by_code_id", - UPLOAD_SCHEMA: "/upload-schema" + UPLOAD_SCHEMA: "/upload-schema", }, LCD_API: { DATA_SOURCES: "/data_sources", @@ -173,8 +174,8 @@ export default Object.freeze({ }, PATH_CONTRACT: { LIST: "/contracts", - UPLOAD_SCHEMA: '/contracts/upload-schema', - GET_NONCE: '/contracts/nonce/', + UPLOAD_SCHEMA: "/contracts/upload-schema", + GET_NONCE: "/contracts/nonce/", }, MENU: [ { @@ -243,7 +244,7 @@ export default Object.freeze({ INFLATION_MAX: "InflationMax", TEXT_PROPOSAL: "TextProposal", UPDATE_ADMIN_PROPOSAL: "UpdateAdminProposal", - COMMUNITY_POOL_SPEND_PROPOSAL: "communityPoolSpendProposal" + COMMUNITY_POOL_SPEND_PROPOSAL: "communityPoolSpendProposal", }, VOTING_PERIOD_OPTIONS: { diff --git a/src/containers/Account/Account.js b/src/containers/Account/Account.js index 67b7e59a..6fc95a1f 100644 --- a/src/containers/Account/Account.js +++ b/src/containers/Account/Account.js @@ -35,6 +35,7 @@ import * as api from "src/lib/api"; import CwToken from "src/components/Wallet/CwToken"; import { formatOrai } from "src/helpers/helper"; import styles from "./Account.module.scss"; +import NFTToken from "../../components/Wallet/NFTToken"; export const typeExport = { cw20: "cw20", @@ -295,6 +296,7 @@ const Account = props => { {activeTab === 0 && } {activeTab === 1 && } {activeTab === 2 && } + {activeTab === 3 && }
diff --git a/src/lib/api.js b/src/lib/api.js index 8ae98dc0..403b0f68 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -80,39 +80,39 @@ export const getListTxs = cancelToken => { }; export const getListCwToken = (address, page) => { - return `${consts.API_BASE}${consts.API.OW20_SMART_CONTRACTS}/${address}?limit=${page?.limit || 1}&page_id=${page?.page_id || 1}` -} + return `${consts.API_BASE}${consts.API.OW20_SMART_CONTRACTS}/${address}?limit=${page?.limit || 1}&page_id=${page?.page_id || 1}`; +}; export const getListNFTToken = (address, page) => { - return `https://api.testnet.scan.orai.io/v1/nft_transaction/${address}?limit=${page?.limit || 1}&page_id=${page?.page_id || 1}`; + return `${consts.API_BASE}${consts.API.NFT_TXS}/${address}?limit=${page?.limit || 10}&page_id=${page?.page_id || 1}`; }; export const getListOWContract = (address, page) => { - return `${consts.API_BASE}${consts.API.OW20_SMART_CONTRACTS}${consts.API.OW20_CONTRACT}/${address}?limit=${page?.limit || 1}&page_id=${page?.page_id || 1}` -} + return `${consts.API_BASE}${consts.API.OW20_SMART_CONTRACTS}${consts.API.OW20_CONTRACT}/${address}?limit=${page?.limit || 1}&page_id=${page?.page_id || 1}`; +}; -export const getGeckoMarketBalance = async (ids = '', currency = 'usd') => { +export const getGeckoMarketBalance = async (ids = "", currency = "usd") => { // remove undefined - ids = ids.replace(new RegExp("\,undefined", "gm"), ""); + ids = ids.replace(new RegExp(",undefined", "gm"), ""); return ids ? await axios(`${consts.API_COINGECKO.PRICE(ids, currency)}`) : { data: {} }; }; -export const getImagesValidator = async (address) => { +export const getImagesValidator = async address => { return await axios.get(`${consts.API_BASE}${consts.API.GET_IMAGES_VALIDATORS}/${address}`); -} +}; export const getListRequest = (aiOracle, aiRequest) => { return axios.get(`${consts.LCD_API_BASE}${consts.LCD_API.WASM}/${aiOracle}/smart/${aiRequest}`); }; -export const uploadImagesValidator = async (data) => { +export const uploadImagesValidator = async data => { return await axios({ url: `${consts.API_BASE}${consts.API.UPLOAD_IMAGES_VALIDATORS}`, ...data }); }; -export const uploadSchema = async (data) => { +export const uploadSchema = async data => { return await axios({ url: `${consts.API_CONTRACT_DEPLOY}${consts.PATH_CONTRACT.UPLOAD_SCHEMA}`, ...data }); }; -export const axiosCall = async (data) => { +export const axiosCall = async data => { return await axios({ ...data }); -}; \ No newline at end of file +};