diff --git a/packages/api/src/dataFeedsRouter.json b/packages/api/src/dataFeedsRouter.json index 527bdc98..a40697a5 100644 --- a/packages/api/src/dataFeedsRouter.json +++ b/packages/api/src/dataFeedsRouter.json @@ -1,6 +1,37 @@ { "abi": "./src/abi/WitnetPriceRouter.json", "chains": { + "avalanche": { + "networks": { + "avalanche.fuji": { + "address": "0x99Af0CF37d1C6b9Bdfe33cc0A89C00D97D3c42F4", + "blockExplorer": "https://testnet.snowtrace.io/address/{address}", + "color": "#E84142", + "name": "Avalanche Fuji", + "pollingPeriod": 15000, + "feeds": { + "Price-AVAX/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 3600, + "minSecsBetweenUpdates": 900 + }, + "Price-BTC/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 3600, + "minSecsBetweenUpdates": 900 + }, + "Price-ETH/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 3600, + "minSecsBetweenUpdates": 900 + } + } + } + } + }, "boba": { "networks": { "boba.rinkeby": { @@ -16,6 +47,12 @@ "maxSecsBetweenUpdates": 86400, "minSecsBetweenUpdates": 900 }, + "Price-OLO/USDC-6": { + "label": "($)", + "deviationPercentage": 0.1, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, "Price-BTC/USD-6": { "label": "$", "deviationPercentage": 1.0, @@ -41,13 +78,13 @@ "minSecsBetweenUpdates": 900 }, "Price-OMG/BTC-9": { - "label": "BTC", + "label": "₿", "deviationPercentage": 1.0, "maxSecsBetweenUpdates": 86400, "minSecsBetweenUpdates": 900 }, "Price-OMG/ETH-9": { - "label": "ETH", + "label": "Ξ", "deviationPercentage": 1.0, "maxSecsBetweenUpdates": 86400, "minSecsBetweenUpdates": 900 diff --git a/packages/api/src/repository/Feed.ts b/packages/api/src/repository/Feed.ts index dcb60264..4a413763 100644 --- a/packages/api/src/repository/Feed.ts +++ b/packages/api/src/repository/Feed.ts @@ -34,8 +34,6 @@ export class FeedRepository { async getPaginatedFeeds ( // starts in 1 - page: number, - size: number, network: string ): Promise { const filteredFeeds = @@ -43,15 +41,16 @@ export class FeedRepository { ? this.sortedDataFeeds : this.dataFeedsByNetwork[network] - const paginatedFeeds = filteredFeeds.slice((page - 1) * size, page * size) - return { - feeds: paginatedFeeds, + feeds: filteredFeeds, total: filteredFeeds.length } } - updateFeedAddress (feedFullName: string, address: string): FeedInfo { + updateFeedAddress ( + feedFullName: string, + { address, contractId }: { address: string; contractId: string } + ): FeedInfo { const hasSameFeedFullName = (feed: FeedInfo) => feed.feedFullName === feedFullName @@ -61,14 +60,18 @@ export class FeedRepository { ) const feed = this.sortedDataFeeds[sortedDataFeedIndex] feed.address = address - - // Update address in dataFeedsByNetwork + feed.contractId = contractId + // Update address in dataFeedsByNetwork cache const dataFeedsByNetworkIndex = this.dataFeedsByNetwork[ feed.network ].findIndex(hasSameFeedFullName) this.dataFeedsByNetwork[feed.network][ dataFeedsByNetworkIndex ].address = address + // Update contractId in dataFeedsByNetwork cache + this.dataFeedsByNetwork[feed.network][ + dataFeedsByNetworkIndex + ].contractId = contractId return feed } diff --git a/packages/api/src/repository/ResultRequest.ts b/packages/api/src/repository/ResultRequest.ts index 9ed824e2..21f68a9a 100644 --- a/packages/api/src/repository/ResultRequest.ts +++ b/packages/api/src/repository/ResultRequest.ts @@ -75,7 +75,6 @@ export class ResultRequestRepository { } } ) - return this.normalizeId(lastResultRequest) } diff --git a/packages/api/src/resolvers.ts b/packages/api/src/resolvers.ts index 2c3f8a92..e73adf9f 100644 --- a/packages/api/src/resolvers.ts +++ b/packages/api/src/resolvers.ts @@ -2,11 +2,7 @@ import { Context, Network } from './types' const resolvers = { Query: { feeds: async (_parent, args, { feedRepository }: Context) => { - return await feedRepository.getPaginatedFeeds( - args.page, - args.pageSize, - args.network - ) + return await feedRepository.getPaginatedFeeds(args.network) }, networks: async (_parent, _args) => { @@ -33,15 +29,28 @@ const resolvers = { ) }, lastResult: async (parent, _args, { resultRequestRepository }: Context) => { + // FIXME: add dataloader library to avoid overfetching return (await resultRequestRepository.getLastResult(parent.feedFullName)) ?.result }, + lastResultTimestamp: async ( + parent, + _args, + { resultRequestRepository }: Context + ) => { + // FIXME: add dataloader library to avoid overfetching + return (await resultRequestRepository.getLastResult(parent.feedFullName)) + ?.timestamp + }, color: async (parent, _args, { config }: Context) => { return config[parent.feedFullName]?.color || '' }, blockExplorer: async (parent, _args, { config }: Context) => { return config[parent.feedFullName]?.blockExplorer || '' }, + proxyAddress: async (parent, _args, { config }: Context) => { + return config[parent.feedFullName]?.routerAddress || '' + }, deviation: async (parent, _args, { config }: Context) => { return config[parent.feedFullName]?.deviation || '' }, diff --git a/packages/api/src/typeDefs.ts b/packages/api/src/typeDefs.ts index 42b77e80..4c67717e 100644 --- a/packages/api/src/typeDefs.ts +++ b/packages/api/src/typeDefs.ts @@ -4,6 +4,7 @@ const typeDefs = gql` type Feed { id: String! address: String! + contractId: String! blockExplorer: String! color: String! feedFullName: String! @@ -11,7 +12,9 @@ const typeDefs = gql` name: String! network: String! lastResult: String + lastResultTimestamp: String deviation: String! + proxyAddress: String heartbeat: String! finality: String! requests(timestamp: Int!): [ResultRequest]! @@ -49,7 +52,7 @@ const typeDefs = gql` type Query { feed(feedFullName: String!): Feed - feeds(page: Int!, pageSize: Int!, network: String): FeedsPage! + feeds(network: String): FeedsPage! requests(feedFullName: String!, page: Int!, size: Int!): [ResultRequest]! networks: [Network]! } diff --git a/packages/api/src/types.ts b/packages/api/src/types.ts index d476b4ae..2e1f4c69 100644 --- a/packages/api/src/types.ts +++ b/packages/api/src/types.ts @@ -25,17 +25,20 @@ export enum Network { EthereumMainnet = 'ethereum-mainnet', EthereumGoerli = 'ethereum-goerli', EthereumRinkeby = 'ethereum-rinkeby', - ConfluxTestnet = 'conflux-testnet', + AvalancheFuji = 'avalanche-fuji', + BobaMainnet = 'boba-mainnet', + BobaRinkeby = 'boba-rinkeby', ConfluxTethys = 'conflux-tethys', - CeloAlfajores = 'celo-alfajores', + ConfluxTestnet = 'conflux-testnet', CeloMainnet = 'celo-mainnet', - BobaRinkeby = 'boba-rinkeby', - BobaMainnet = 'boba-mainnet', - MetisRinkeby = 'metis-rinkeby', + CeloAlfajores = 'celo-alfajores', HarmonyTestnet = 'harmony-testnet', - KCCTestnet = 'kcc-testnet', + MetisMainnet = 'metis-mainnet', + MetisRinkeby = 'metis-rinkeby', + PolygonMainnet = 'polygon-mainnet', + PolygonGoerli = 'polygon-goerli', KCCMainnet = 'kcc-mainnet', - PolygonGoerli = 'polygon-goerli' + KCCTestnet = 'kcc-testnet' } export type FeedInfoGeneric = { @@ -49,6 +52,7 @@ export type FeedInfoGeneric = { name: string pollingPeriod: number label: string + contractId: string color: string blockExplorer: string deviation: string @@ -64,6 +68,11 @@ export type PaginatedFeedsObject = { total: number } +export type ContractInfo = { + contractAddress: string + contractId: string +} + export type ResultRequestDbObjectNormalized = ResultRequestDbObject & { id: string } diff --git a/packages/api/src/utils/index.ts b/packages/api/src/utils/index.ts index 50b73857..a621da80 100644 --- a/packages/api/src/utils/index.ts +++ b/packages/api/src/utils/index.ts @@ -78,6 +78,7 @@ export function normalizeConfig ( feedFullName: createFeedFullName(network, name, decimals), id: feed.key, address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', routerAddress: config.address, network, name, @@ -99,6 +100,10 @@ export function normalizeConfig ( return feeds } +export function isZeroAddress (address: string) { + return address === '0x0000000000000000000000000000000000000000' +} + export function sleep (ms) { return new Promise(resolve => setTimeout(resolve, ms)) } diff --git a/packages/api/src/web3Middleware/index.ts b/packages/api/src/web3Middleware/index.ts index 46c38846..96dff7bc 100644 --- a/packages/api/src/web3Middleware/index.ts +++ b/packages/api/src/web3Middleware/index.ts @@ -6,8 +6,10 @@ import { FeedInfo, Repositories, ResultRequestDbObject, - ObjectId + ObjectId, + ContractInfo } from '../types' +import { isZeroAddress } from '../utils/index' import { getProvider } from './provider' export class Web3Middleware { @@ -28,23 +30,29 @@ export class Web3Middleware { } public async initializeAddresses (): Promise> { - const promises = this.dataFeeds.map(feed => this.updateAddress(feed)) + const promises = this.dataFeeds.map(feed => this.updateFeed(feed)) return await Promise.all(promises) } - async updateAddress (feedInfo: FeedInfo) { - const contractAddress = await this.getContractAddress(feedInfo) + async updateFeed (feedInfo: FeedInfo) { + const contractInfo = await this.getContractInfo(feedInfo) const feed = this.repositories.feedRepository.get(feedInfo.feedFullName) - if (feed && contractAddress && contractAddress !== feed.address) { + if ( + contractInfo?.contractAddress && + contractInfo?.contractAddress !== feed?.address + ) { return this.repositories.feedRepository.updateFeedAddress( feedInfo.feedFullName, - contractAddress + { + address: contractInfo.contractAddress, + contractId: contractInfo.contractId + } ) } - return feedInfo + return feedInfo } async listen () { @@ -68,7 +76,7 @@ export class Web3Middleware { feeds.forEach(feed => { const feedInfo = feedDictionary[feed?.feedFullName]?.feedInfo if (feedInfo) { - this.updateAddress(feedInfo) + this.updateFeed(feedInfo) } }) @@ -89,7 +97,7 @@ export class Web3Middleware { this.intervals = [] } - async getContractAddress (feedInfo: FeedInfo): Promise { + async getContractInfo (feedInfo: FeedInfo): Promise { try { return await new Promise(async (resolve, reject) => { try { @@ -113,7 +121,10 @@ export class Web3Middleware { .getPriceFeed(contractIdentifier) .call() - resolve(address) + resolve({ + contractAddress: address, + contractId: contractIdentifier + }) } catch (err) { reject(err) } @@ -127,22 +138,23 @@ export class Web3Middleware { } async listenToDataFeed (feedInfo: FeedInfo) { - const contractAddress = await this.getContractAddress(feedInfo) + const contractInfo = await this.getContractInfo(feedInfo) const provider = getProvider(feedInfo.network) if (provider) { if ( - contractAddress && - contractAddress !== '0x0000000000000000000000000000000000000000' + contractInfo && + contractInfo.contractAddress && + !isZeroAddress(contractInfo.contractAddress) ) { try { const web3 = new this.Web3(provider) const feedContract = new web3.eth.Contract( feedInfo.abi, - contractAddress + contractInfo.contractAddress ) const interval = setInterval(async () => { console.log( - `Reading ${feedInfo.feedFullName} contract state at address: ${contractAddress}` + `Reading ${feedInfo.feedFullName} contract state at address: ${contractInfo.contractAddress}` ) await this.fetchAndSaveContractSnapshot( { feedContract }, diff --git a/packages/api/src/web3Middleware/provider.ts b/packages/api/src/web3Middleware/provider.ts index 364d1363..43684eec 100644 --- a/packages/api/src/web3Middleware/provider.ts +++ b/packages/api/src/web3Middleware/provider.ts @@ -11,11 +11,14 @@ export function getProvider (network: Network) { [Network.BobaMainnet]: process.env.BOBA_MAINNET_PROVIDER, [Network.CeloAlfajores]: process.env.CELO_ALFAJORES_PROVIDER, [Network.CeloMainnet]: process.env.CELO_MAINNET_PROVIDER, + [Network.MetisMainnet]: process.env.METIS_MAINNET_PROVIDER, [Network.MetisRinkeby]: process.env.METIS_RINKEBY_PROVIDER, [Network.HarmonyTestnet]: process.env.HARMONY_TESTNET_PROVIDER, [Network.KCCTestnet]: process.env.KCC_TESTNET_PROVIDER, [Network.KCCMainnet]: process.env.KCC_MAINNET_PROVIDER, - [Network.PolygonGoerli]: process.env.POLYGON_GOERLI_PROVIDER + [Network.PolygonMainnet]: process.env.POLYGON_MAINNET_PROVIDER, + [Network.PolygonGoerli]: process.env.POLYGON_GOERLI_PROVIDER, + [Network.AvalancheFuji]: process.env.AVALANCHE_FUJI_PROVIDER } return providers[network] } diff --git a/packages/api/test/validateFeedsConfig.spec.ts b/packages/api/test/validateFeedsConfig.spec.ts index 151126d4..31699424 100644 --- a/packages/api/test/validateFeedsConfig.spec.ts +++ b/packages/api/test/validateFeedsConfig.spec.ts @@ -5,20 +5,69 @@ import { normalizeConfig } from '../src/utils/index' describe('validateDataFeedsConfig', () => { it('check if the structure is correct', async () => { const dataFeedsRouterConfig = JSON.parse( - fs.readFileSync(path.resolve('./src/dataFeedsRouter.json'), 'utf-8') + fs.readFileSync(path.resolve('./test/web3Middleware/dataFeedsRouter.json'), 'utf-8') ) const feeds = normalizeConfig(dataFeedsRouterConfig) const expected = [ { address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://testnet.snowtrace.io/address/{address}', + color: '#E84142', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '1', + feedFullName: 'avalanche-fuji_avax-usd_6', + finality: '900000', + heartbeat: '3600000', + id: 'Price-AVAX/USD-6', + label: '$', + name: 'avax/usd', + network: 'avalanche-fuji', + pollingPeriod: 15000, + routerAddress: '0x99Af0CF37d1C6b9Bdfe33cc0A89C00D97D3c42F4' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://testnet.snowtrace.io/address/{address}', + color: '#E84142', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '1', + feedFullName: 'avalanche-fuji_btc-usd_6', + finality: '900000', + heartbeat: '3600000', + id: 'Price-BTC/USD-6', + label: '$', + name: 'btc/usd', + network: 'avalanche-fuji', + pollingPeriod: 15000, + routerAddress: '0x99Af0CF37d1C6b9Bdfe33cc0A89C00D97D3c42F4' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://testnet.snowtrace.io/address/{address}', + color: '#E84142', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '1', + feedFullName: 'avalanche-fuji_eth-usd_6', + finality: '900000', + heartbeat: '3600000', + id: 'Price-ETH/USD-6', + label: '$', + name: 'eth/usd', + network: 'avalanche-fuji', + pollingPeriod: 15000, + routerAddress: '0x99Af0CF37d1C6b9Bdfe33cc0A89C00D97D3c42F4' + }, + { + address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_boba-usdt_6', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-BOBA/USDT-6', label: '₮', name: 'boba/usdt', @@ -28,13 +77,14 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_btc-usd_6', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-BTC/USD-6', label: '$', name: 'btc/usd', @@ -44,13 +94,14 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_eth-usd_6', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-ETH/USD-6', label: '$', name: 'eth/usd', @@ -63,10 +114,28 @@ describe('validateDataFeedsConfig', () => { blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '0.1', + feedFullName: 'boba-rinkeby_frax-usdt_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-FRAX/USDT-6', + label: '₮', + name: 'frax/usdt', + network: 'boba-rinkeby', + pollingPeriod: 15000, + routerAddress: '0x36928Aeedaaf7D85bcA39aDfB2A39ec529ce221a' + }, + { + address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', + blockExplorer: + 'https://blockexplorer.rinkeby.boba.network/address/{address}', + color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_fxs-usdt_6', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-FXS/USDT-6', label: '₮', name: 'fxs/usdt', @@ -76,15 +145,16 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_omg-btc_9', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-OMG/BTC-9', - label: 'BTC', + label: '₿', name: 'omg/btc', network: 'boba-rinkeby', pollingPeriod: 15000, @@ -92,15 +162,16 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_omg-eth_9', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-OMG/ETH-9', - label: 'ETH', + label: 'Ξ', name: 'omg/eth', network: 'boba-rinkeby', pollingPeriod: 15000, @@ -108,13 +179,14 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.rinkeby.boba.network/address/{address}', color: '#1cd83d', deviation: '1', feedFullName: 'boba-rinkeby_omg-usdt_6', finality: '900000', - heartbeat: '3600000', + heartbeat: '86400000', id: 'Price-OMG/USDT-6', label: '₮', name: 'omg/usdt', @@ -122,10 +194,45 @@ describe('validateDataFeedsConfig', () => { pollingPeriod: 15000, routerAddress: '0x36928Aeedaaf7D85bcA39aDfB2A39ec529ce221a' }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: + 'https://blockexplorer.rinkeby.boba.network/address/{address}', + color: '#1cd83d', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '0.1', + feedFullName: 'boba-rinkeby_usdc-usd_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-USDC/USD-6', + label: '$', + name: 'usdc/usd', + network: 'boba-rinkeby', + pollingPeriod: 15000, + routerAddress: '0x36928Aeedaaf7D85bcA39aDfB2A39ec529ce221a' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: + 'https://blockexplorer.rinkeby.boba.network/address/{address}', + color: '#1cd83d', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '0.1', + feedFullName: 'boba-rinkeby_usdt-usd_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-USDT/USD-6', + label: '$', + name: 'usdt/usd', + network: 'boba-rinkeby', + pollingPeriod: 15000, + routerAddress: '0x36928Aeedaaf7D85bcA39aDfB2A39ec529ce221a' + }, { address: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.boba.network/address/{address}', color: '#007dff', + contractId: '0x0000000000000000000000000000000000000000', deviation: '1', feedFullName: 'boba-mainnet_boba-usdt_6', finality: '900000', @@ -141,6 +248,7 @@ describe('validateDataFeedsConfig', () => { address: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.boba.network/address/{address}', color: '#007dff', + contractId: '0x0000000000000000000000000000000000000000', deviation: '1', feedFullName: 'boba-mainnet_btc-usd_6', finality: '900000', @@ -156,6 +264,7 @@ describe('validateDataFeedsConfig', () => { address: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://blockexplorer.boba.network/address/{address}', color: '#007dff', + contractId: '0x0000000000000000000000000000000000000000', deviation: '1', feedFullName: 'boba-mainnet_eth-usd_6', finality: '900000', @@ -169,6 +278,55 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://blockexplorer.boba.network/address/{address}', + color: '#007dff', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '0.25', + feedFullName: 'boba-mainnet_frax-usdt_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-FRAX/USDT-6', + label: '₮', + name: 'frax/usdt', + network: 'boba-mainnet', + pollingPeriod: 15000, + routerAddress: '0x93f61D0D5F623144e7C390415B70102A9Cc90bA5' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://blockexplorer.boba.network/address/{address}', + color: '#007dff', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '0.25', + feedFullName: 'boba-mainnet_usdc-usd_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-USDC/USD-6', + label: '$', + name: 'usdc/usd', + network: 'boba-mainnet', + pollingPeriod: 15000, + routerAddress: '0x93f61D0D5F623144e7C390415B70102A9Cc90bA5' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://blockexplorer.boba.network/address/{address}', + color: '#007dff', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '0.25', + feedFullName: 'boba-mainnet_usdt-usd_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-USDT/USD-6', + label: '$', + name: 'usdt/usd', + network: 'boba-mainnet', + pollingPeriod: 15000, + routerAddress: '0x93f61D0D5F623144e7C390415B70102A9Cc90bA5' + }, + { + address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://alfajores-blockscout.celo-testnet.org/address/{address}', color: '#1cd8d2', @@ -185,6 +343,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://alfajores-blockscout.celo-testnet.org/address/{address}', color: '#1cd8d2', @@ -201,6 +360,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://alfajores-blockscout.celo-testnet.org/address/{address}', color: '#1cd8d2', @@ -217,6 +377,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://alfajores-blockscout.celo-testnet.org/address/{address}', color: '#1cd8d2', @@ -233,6 +394,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://explorer.celo.org/address/{address}', color: '#ff8100', deviation: '1', @@ -248,6 +410,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://explorer.celo.org/address/{address}', color: '#ff8100', deviation: '1', @@ -263,6 +426,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://explorer.celo.org/address/{address}', color: '#ff8100', deviation: '3.5', @@ -278,6 +442,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://explorer.celo.org/address/{address}', color: '#ff8100', deviation: '3.5', @@ -293,6 +458,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://testnet.confluxscan.io/address/{address}', color: '#6600ff', deviation: '1', @@ -308,6 +474,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://testnet.confluxscan.io/address/{address}', color: '#6600ff', deviation: '1', @@ -323,6 +490,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://testnet.confluxscan.io/address/{address}', color: '#6600ff', deviation: '1', @@ -338,6 +506,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://confluxscan.io/address/{address}', color: '#ff0000', deviation: '1', @@ -353,6 +522,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://confluxscan.io/address/{address}', color: '#ff0000', deviation: '3.5', @@ -368,6 +538,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://confluxscan.io/address/{address}', color: '#ff0000', deviation: '3.5', @@ -383,6 +554,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://goerli.etherscan.io/address/{address}', color: '#ff5599', deviation: '1', @@ -398,6 +570,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://goerli.etherscan.io/address/{address}', color: '#ff5599', deviation: '1', @@ -413,6 +586,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://rinkeby.etherscan.io/address/{address}', color: '#ff5599', deviation: '1', @@ -428,6 +602,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://rinkeby.etherscan.io/address/{address}', color: '#ff5599', deviation: '1', @@ -443,6 +618,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://etherscan.io/address/{address}', color: '#ff5599', deviation: '3.5', @@ -458,6 +634,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://etherscan.io/address/{address}', color: '#ff5599', deviation: '3.5', @@ -473,6 +650,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://explorer.pops.one/address/{address}', color: '#f6006f', deviation: '1', @@ -488,6 +666,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://explorer.pops.one/address/{address}', color: '#f6006f', deviation: '1', @@ -503,6 +682,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://scan-testnet.kcc.network/address/{address}', color: '#ff0066', deviation: '0.5', @@ -518,6 +698,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://scan-testnet.kcc.network/address/{address}', color: '#ff0066', deviation: '0.5', @@ -533,6 +714,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://scan-testnet.kcc.network/address/{address}', color: '#ff0066', deviation: '0.5', @@ -548,6 +730,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://scan.kcc.io/address/{address}', color: '#ff0066', deviation: '0.5', @@ -563,6 +746,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://scan.kcc.io/address/{address}', color: '#ff0066', deviation: '0.5', @@ -578,6 +762,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://scan.kcc.io/address/{address}', color: '#ff0066', deviation: '0.5', @@ -593,6 +778,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://stardust-explorer.metis.io/address/{address}', color: '#ff6600', deviation: '1', @@ -608,6 +794,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://stardust-explorer.metis.io/address/{address}', color: '#ff6600', deviation: '1', @@ -623,6 +810,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://stardust-explorer.metis.io/address/{address}', color: '#ff6600', deviation: '1', @@ -638,6 +826,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://andromeda-explorer.metis.io/address/{address}', color: '#ff6600', deviation: '2', @@ -653,6 +842,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://mumbai.polygonscan.com/address/{address}', color: '#66ff00', deviation: '3.5', @@ -668,6 +858,7 @@ describe('validateDataFeedsConfig', () => { }, { address: '0x0000000000000000000000000000000000000000', + contractId: '0x0000000000000000000000000000000000000000', blockExplorer: 'https://mumbai.polygonscan.com/address/{address}', color: '#66ff00', deviation: '3.5', @@ -680,6 +871,38 @@ describe('validateDataFeedsConfig', () => { network: 'polygon-goerli', pollingPeriod: 15000, routerAddress: '0x6d5544ca5b35bf2e7a78ace4E7B8d191fe5C9FAb' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://polygonscan.com/address/{address}', + color: '#66ff00', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '1', + feedFullName: 'polygon-mainnet_btc-usd_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-BTC/USD-6', + label: '$', + name: 'btc/usd', + network: 'polygon-mainnet', + pollingPeriod: 15000, + routerAddress: '0x3806311c7138ddF2bAF2C2093ff3633E5A73AbD4' + }, + { + address: '0x0000000000000000000000000000000000000000', + blockExplorer: 'https://polygonscan.com/address/{address}', + color: '#66ff00', + contractId: '0x0000000000000000000000000000000000000000', + deviation: '1', + feedFullName: 'polygon-mainnet_eth-usd_6', + finality: '900000', + heartbeat: '86400000', + id: 'Price-ETH/USD-6', + label: '$', + name: 'eth/usd', + network: 'polygon-mainnet', + pollingPeriod: 15000, + routerAddress: '0x3806311c7138ddF2bAF2C2093ff3633E5A73AbD4' } ] diff --git a/packages/api/test/web3Middleware/dataFeedsRouter.json b/packages/api/test/web3Middleware/dataFeedsRouter.json index 2c924f00..b1125b47 100644 --- a/packages/api/test/web3Middleware/dataFeedsRouter.json +++ b/packages/api/test/web3Middleware/dataFeedsRouter.json @@ -1,6 +1,37 @@ { "abi": "./src/abi/WitnetPriceRouter.json", "chains": { + "avalanche": { + "networks": { + "avalanche.fuji": { + "address": "0x99Af0CF37d1C6b9Bdfe33cc0A89C00D97D3c42F4", + "blockExplorer": "https://testnet.snowtrace.io/address/{address}", + "color": "#E84142", + "name": "Avalanche Fuji", + "pollingPeriod": 15000, + "feeds": { + "Price-AVAX/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 3600, + "minSecsBetweenUpdates": 900 + }, + "Price-BTC/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 3600, + "minSecsBetweenUpdates": 900 + }, + "Price-ETH/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 3600, + "minSecsBetweenUpdates": 900 + } + } + } + } + }, "boba": { "networks": { "boba.rinkeby": { @@ -13,44 +44,62 @@ "Price-BOBA/USDT-6": { "label": "₮", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 }, "Price-BTC/USD-6": { "label": "$", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 }, "Price-ETH/USD-6": { "label": "$", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, + "Price-FRAX/USDT-6": { + "label": "₮", + "deviationPercentage": 0.1, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 }, "Price-FXS/USDT-6": { "label": "₮", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 }, "Price-OMG/BTC-9": { - "label": "BTC", + "label": "₿", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 }, "Price-OMG/ETH-9": { - "label": "ETH", + "label": "Ξ", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 }, "Price-OMG/USDT-6": { "label": "₮", "deviationPercentage": 1.0, - "maxSecsBetweenUpdates": 3600, - "minSecsBetweenUpdates": 300 + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, + "Price-USDC/USD-6": { + "label": "$", + "deviationPercentage": 0.1, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, + "Price-USDT/USD-6": { + "label": "$", + "deviationPercentage": 0.1, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 } } }, @@ -65,7 +114,7 @@ "label": "₮", "deviationPercentage": 1.0, "maxSecsBetweenUpdates": 86400, - "minSecsBetweenUpdates": 3600 + "minSecsBetweenUpdates": 900 }, "Price-BTC/USD-6": { "label": "$", @@ -78,6 +127,24 @@ "deviationPercentage": 1.0, "maxSecsBetweenUpdates": 86400, "minSecsBetweenUpdates": 3600 + }, + "Price-FRAX/USDT-6": { + "label": "₮", + "deviationPercentage": 0.25, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, + "Price-USDC/USD-6": { + "label": "$", + "deviationPercentage": 0.25, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, + "Price-USDT/USD-6": { + "label": "$", + "deviationPercentage": 0.25, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 } } } @@ -224,7 +291,7 @@ "label": "$", "deviationPercentage": 1.0, "maxSecsBetweenUpdates": 28800, - "minSecsBetweenUpdates": 900 + "minSecsBetweenUpdates": 900 }, "Price-ETH/USD-6": { "label": "$", @@ -389,6 +456,21 @@ "minSecsBetweenUpdates": 900 } } + }, + "metis.mainnet": { + "address": "0xD39D4d972C7E166856c4eb29E54D3548B4597F53", + "blockExplorer": "https://andromeda-explorer.metis.io/address/{address}", + "color": "#ff6600", + "name": "Metis Mainnet", + "pollingPeriod": 15000, + "feeds": { + "Price-METIS/USDT-6": { + "label": "₮", + "deviationPercentage": 2.0, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + } + } } } }, @@ -414,8 +496,29 @@ "minSecsBetweenUpdates": 3600 } } + }, + "polygon.mainnet": { + "address": "0x3806311c7138ddF2bAF2C2093ff3633E5A73AbD4", + "blockExplorer": "https://polygonscan.com/address/{address}", + "color": "#66ff00", + "name": "Polygon Mainnet", + "pollingPeriod": 15000, + "feeds": { + "Price-BTC/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + }, + "Price-ETH/USD-6": { + "label": "$", + "deviationPercentage": 1.0, + "maxSecsBetweenUpdates": 86400, + "minSecsBetweenUpdates": 900 + } + } } } } } -} +} \ No newline at end of file diff --git a/packages/ui/apollo/queries/feed.gql b/packages/ui/apollo/queries/feed.gql index 2e376f7d..d47a1f8f 100644 --- a/packages/ui/apollo/queries/feed.gql +++ b/packages/ui/apollo/queries/feed.gql @@ -3,10 +3,12 @@ query feed($feedFullName: String!, $timestamp: Int!) { feedFullName name address + contractId lastResult network label deviation + proxyAddress heartbeat finality requests(timestamp: $timestamp) { diff --git a/packages/ui/apollo/queries/feeds.gql b/packages/ui/apollo/queries/feeds.gql index 70c52590..a7eb0974 100644 --- a/packages/ui/apollo/queries/feeds.gql +++ b/packages/ui/apollo/queries/feeds.gql @@ -1,14 +1,17 @@ -query feeds ($page: Int!, $pageSize: Int!, $network: String!) { - feeds (page: $page, pageSize: $pageSize, network: $network) { +query feeds ($network: String!) { + feeds (network: $network) { feeds { feedFullName name address lastResult + lastResultTimestamp network label blockExplorer color + heartbeat + finality } total } diff --git a/packages/ui/assets/content.scss b/packages/ui/assets/content.scss index 219c1548..dafe39a3 100644 --- a/packages/ui/assets/content.scss +++ b/packages/ui/assets/content.scss @@ -1,21 +1,14 @@ .nuxt-content { h1 { - font-size: 4rem; font-weight: bold; } h2 { - font-size: 2rem; font-weight: bold; } h3 { - font-size: 1.8rem; font-weight: bold; } h4 { - font-size: 1.4rem; font-weight: bold; } - p { - font-size: 1rem; - } } diff --git a/packages/ui/assets/fonts/5616356/8a2ab6e1-4ba1-439f-a73b-29918942af3b.woff b/packages/ui/assets/fonts/5616356/8a2ab6e1-4ba1-439f-a73b-29918942af3b.woff new file mode 100644 index 00000000..74bc200e Binary files /dev/null and b/packages/ui/assets/fonts/5616356/8a2ab6e1-4ba1-439f-a73b-29918942af3b.woff differ diff --git a/packages/ui/assets/fonts/5616356/cf7047b5-ced0-4cb1-b66e-688e29567e96.woff2 b/packages/ui/assets/fonts/5616356/cf7047b5-ced0-4cb1-b66e-688e29567e96.woff2 new file mode 100644 index 00000000..ee46b163 Binary files /dev/null and b/packages/ui/assets/fonts/5616356/cf7047b5-ced0-4cb1-b66e-688e29567e96.woff2 differ diff --git a/packages/ui/assets/fonts/5835004/20522a37-c9e1-4059-b349-66eee8da006b.woff b/packages/ui/assets/fonts/5835004/20522a37-c9e1-4059-b349-66eee8da006b.woff new file mode 100644 index 00000000..b9716af4 Binary files /dev/null and b/packages/ui/assets/fonts/5835004/20522a37-c9e1-4059-b349-66eee8da006b.woff differ diff --git a/packages/ui/assets/fonts/5835004/42801c92-f679-41d6-ab36-6c7ca7c7fa6c.woff2 b/packages/ui/assets/fonts/5835004/42801c92-f679-41d6-ab36-6c7ca7c7fa6c.woff2 new file mode 100644 index 00000000..583e1c63 Binary files /dev/null and b/packages/ui/assets/fonts/5835004/42801c92-f679-41d6-ab36-6c7ca7c7fa6c.woff2 differ diff --git a/packages/ui/assets/fonts/style.css b/packages/ui/assets/fonts/style.css new file mode 100644 index 00000000..d3973bd9 --- /dev/null +++ b/packages/ui/assets/fonts/style.css @@ -0,0 +1,9 @@ +@font-face{ + font-family:"Avenir Next Variable W05 Itali"; + src: url("5616356/cf7047b5-ced0-4cb1-b66e-688e29567e96.woff2") format("woff2"), url("5616356/8a2ab6e1-4ba1-439f-a73b-29918942af3b.woff") format("woff"); +} + +@font-face{ + font-family:"Avenir Next Variable W05835004"; + src: url("5835004/42801c92-f679-41d6-ab36-6c7ca7c7fa6c.woff2") format("woff2"), url("5835004/20522a37-c9e1-4059-b349-66eee8da006b.woff") format("woff"); +} \ No newline at end of file diff --git a/packages/ui/assets/styles/colors.scss b/packages/ui/assets/styles/colors.scss deleted file mode 100644 index 623c26a2..00000000 --- a/packages/ui/assets/styles/colors.scss +++ /dev/null @@ -1,18 +0,0 @@ -$white: white; -$black: black; -// GREENS -$green-1: #5fbfae; -$green-2: #468d80; -//BLUES -$blue-1: #758ea9; -$blue-2: #526488; -$blue-3: #35495e; -$blue-4: #214060; -$dark-blue: #2D2C39; -$dark-blur: #2d2c39d3; -$red: #E54343; -//GREYS -$grey-1: #e4e4e4; -$grey-2: #999; -$grey-3: #5f5f5f; -$grey-4: #4d4d4d; \ No newline at end of file diff --git a/packages/ui/assets/styles/main.scss b/packages/ui/assets/styles/main.scss index cd79c3c8..f8050aad 100644 --- a/packages/ui/assets/styles/main.scss +++ b/packages/ui/assets/styles/main.scss @@ -1,4 +1,8 @@ :root { + --text-size-title: 24px; + --text-size: 16px; + --text-size-small: 12px; + --text-size-medium: 14px; --bg: #2D2C39; --responsive-menu: #fdfdfd; --text: #fdfdfd; @@ -14,6 +18,11 @@ --app-background-color: #2D2C39; --pagination-button: grey; + //Tooltip + + --tooltip-background: #FFFFFF10; + --tooltip-bg: #2D2C39; + // Select @@ -23,14 +32,16 @@ --selected-icon: #62B1B058; --selected-options-background: #37414c; --selected-options-text: #e7e7e7; - --selected-options-border: 2px solid #62B1B015;; + --selected-options-border: 2px solid #62B1B015; --selected-options-shadow: 1px 1px 10 2px #62B1B029; --selected-options-highlight: #62B1B015; // FeedCard - --card-border: 2px solid #62B1B015; + --card-border: 2px solid #00D4AA16; --card-background: #62B1B015; + --delay-status-border: 2px solid #DFC44B23; + --error-status-border: 2px solid #DF4B4B23; //Fieledset @@ -53,7 +64,7 @@ // links - --transaction-blur-background: #FFFFFF10; + --transaction-blur-background: #ffffff09; //ThemeSwitch @@ -72,15 +83,23 @@ --switcher-item-background: #41BEA5; --switcher-item-color: white; + + //footer + --footer-bg: #4AB6A1; + + //breadcrumbs + --selected-option: #41BEA5; } .dark-mode { --bg: #2D2C39; --responsive-menu: #fdfdfd; --text: #fdfdfd; + --light-text: #bebebe; --link: #E54343; --text-background: #2d2c39d3; --default-border: 1px solid #fdfdfd; + --white-text: #fdfdfd; //Pagination @@ -94,6 +113,7 @@ //Tooltip --tooltip-background: #FFFFFF10; + --tooltip-bg: #2D2C39; // Select @@ -109,8 +129,10 @@ // FeedCard - --card-border: 2px solid #62b1b048; - --card-background: #62B1B015; + --card-border: 2px solid #00D4AA16; + --card-background: #00D4AA08; + --delay-status-border: 2px solid #DFC44B23; + --error-status-border: 2px solid #DF4B4B23; //Fieledset @@ -125,6 +147,7 @@ //NavBar --nav-bar-background: #2d2c39; + --nav-bar-slash-color: #5fbfae; // links @@ -148,19 +171,40 @@ --contract-address: #41BEA5; - //switcher + //Switcher - --switcher-item-background: #41BEA5; - --switcher-item-color: white; + --switcher-item-background: #41BEA5; + --switcher-item-color: white; + + //Button + + --btn-primary-color: #EDEDED; + --btn-primary-background-color: #00D4AA16; + --btn-primary-border-color: #00D4AA16; + --btn-secondary-color: #4AB6A1; + --btn-secondary-background-color: #4AB6A1; + --btn-secondary-border-color: #4AB6A1; + + //footer + --footer-bg: #4ab6a02c; + + //sidebar + --tab-gradient: linear-gradient(90deg, #2d2c39d3 95%, #4ab6a02c); + --tab-gradient-selected: linear-gradient(90deg, #2d2c39d3 0%, rgba(74, 182, 160, 0.05) 20%, rgba(74, 182, 160, 0.10) 24%, rgba(74, 182, 160, 0.15) 30%, rgba(74, 182, 160, 0.173) 35%); + + //breadcrumbs + --selected-option: #4AB6A1; } .light-mode { --bg: #fdfdfd; --responsive-menu: #2D2C39; --text: #2D2C39; + --light-text: #767575; --link: #E54343; --text-background: #ffffffd3; --default-border: 1px solid #2D2C39; + --white-text: #fdfdfd; //Pagination @@ -173,6 +217,7 @@ //Tooltip --tooltip-background: #2d2c3910; + --tooltip-bg: #f6f6f7; // Select @@ -188,15 +233,18 @@ // FeedCard - --card-border: 2px solid hsl(168, 49%, 50%); - --card-background: #fdfdfd; - --name-color: #1F1F24; - --value-color: #1F1F24; - --card-box-shadow: #1f1f2421 0 4px 16px; + --card-border: 1px solid #4ab6a0; + --delay-status-border: 1px solid #DFC44B; + --error-status-border: 1px solid #df4b4b; + --card-background: transparent; + --name-color: #2D2C39; + --value-color: #2D2C39; + --card-box-shadow: #98979716 0 4px 4px; + //Fieledset --fieldset-title: #2D2C39; - --fieldset-background: #2d2c3910; + --fieldset-background: #2d2c3908; //Logo --logo-dot: #41BEA5; @@ -205,6 +253,7 @@ //NavBar --nav-bar-background: #fdfdfd; + --nav-bar-slash-color: #5fbfae; // links @@ -213,7 +262,7 @@ // links - --transaction-blur-background: #2d2c3907; + --transaction-blur-background: #2d2c3905; //ThemeSwitch @@ -232,30 +281,57 @@ --switcher-item-background: #41BEA5; --switcher-item-color: #2D2C39; + + //Button + + --btn-primary-color: #FDFDFD; + --btn-primary-background-color: #4AB6A1; + --btn-primary-border-color: #4AB6A1; + --btn-secondary-color: #4AB6A1; + --btn-secondary-background-color: #4AB6A1; + --btn-secondary-border-color: hsl(168, 43%, 50%); + + //footer + --footer-bg: #4AB6A1; + + //sidebar + --tab-gradient: linear-gradient(90deg, #fdfdfd 95%, #cbf5ed); + --tab-background: #fdfdfd; + --tab-gradient-selected: linear-gradient(90deg, #fdfdfd 0%, rgba(74, 182, 160, 0.80) 20%, rgba(74, 182, 160, 0.90) 24%, rgba(74, 182, 160, 0.97) 30%, rgba(74,182,161,1) 35%); + + //breadcrumbs + --selected-option: #41BEA5; } h1 { - font-size: 4rem; font-weight: bold; - font-family: 'Almarai', sans-serif; + font-family: 'Avenir Next Variable W05835004', Arial, Helvetica, sans-serif; } p { - font-size: 1.4rem; font-family: 'Almarai', sans-serif; - - &.subtitle { - font-size: 0.87rem; - } + line-height: 1.5; &.title { - font-size: 1.12rem; - } - &.small-description { - font-size: 0.75rem; - } - &.copyright { - font-size: 0.625rem; + font-family: 'Avenir Next Variable W05835004', Arial, Helvetica, sans-serif; } } +.btn { + font-family: 'Almarai', sans-serif; +} +.logo-subtitle { + font-family: 'Avenir Next Variable W05835004', Arial, Helvetica, sans-serif; +} +.title { + font-family: 'Avenir Next Variable W05835004', Arial, Helvetica, sans-serif; +} +.bold { + font-weight: bold; +} +.light-text { + color: var(--light-text); +} +.text { + color: var(--text); +} a { text-decoration: none; diff --git a/packages/ui/assets/svg/.DS_Store b/packages/ui/assets/svg/.DS_Store new file mode 100644 index 00000000..73c7b7a0 Binary files /dev/null and b/packages/ui/assets/svg/.DS_Store differ diff --git a/packages/ui/assets/svg/avalanche.svg b/packages/ui/assets/svg/avalanche.svg new file mode 100644 index 00000000..a8f9fa48 --- /dev/null +++ b/packages/ui/assets/svg/avalanche.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/ui/assets/svg/avax.svg b/packages/ui/assets/svg/avax.svg new file mode 100644 index 00000000..a8f9fa48 --- /dev/null +++ b/packages/ui/assets/svg/avax.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/ui/assets/svg/boba.svg b/packages/ui/assets/svg/boba.svg index 6daf19f7..9582b917 100644 --- a/packages/ui/assets/svg/boba.svg +++ b/packages/ui/assets/svg/boba.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/btc.svg b/packages/ui/assets/svg/btc.svg index 62f7e133..de6c1166 100644 --- a/packages/ui/assets/svg/btc.svg +++ b/packages/ui/assets/svg/btc.svg @@ -1,3 +1,3 @@ - + diff --git a/packages/ui/assets/svg/celo.svg b/packages/ui/assets/svg/celo.svg index 8525f7cb..c37a53ce 100644 --- a/packages/ui/assets/svg/celo.svg +++ b/packages/ui/assets/svg/celo.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/cfx.svg b/packages/ui/assets/svg/cfx.svg index b1ac1120..dea02f18 100644 --- a/packages/ui/assets/svg/cfx.svg +++ b/packages/ui/assets/svg/cfx.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/conflux.svg b/packages/ui/assets/svg/conflux.svg new file mode 100644 index 00000000..dea02f18 --- /dev/null +++ b/packages/ui/assets/svg/conflux.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/ui/assets/svg/eth.svg b/packages/ui/assets/svg/eth.svg index 5fdb5b80..fa915ae9 100644 --- a/packages/ui/assets/svg/eth.svg +++ b/packages/ui/assets/svg/eth.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/ethereum.svg b/packages/ui/assets/svg/ethereum.svg new file mode 100644 index 00000000..0f75a807 --- /dev/null +++ b/packages/ui/assets/svg/ethereum.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/ui/assets/svg/frax.svg b/packages/ui/assets/svg/frax.svg new file mode 100644 index 00000000..bc977e77 --- /dev/null +++ b/packages/ui/assets/svg/frax.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/ui/assets/svg/fxs.svg b/packages/ui/assets/svg/fxs.svg index ee453fab..edfecd31 100644 --- a/packages/ui/assets/svg/fxs.svg +++ b/packages/ui/assets/svg/fxs.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/github.svg b/packages/ui/assets/svg/github.svg index 5d236280..3910a188 100644 --- a/packages/ui/assets/svg/github.svg +++ b/packages/ui/assets/svg/github.svg @@ -1,3 +1,3 @@ - + diff --git a/packages/ui/assets/svg/harmony.svg b/packages/ui/assets/svg/harmony.svg new file mode 100644 index 00000000..d67330e9 --- /dev/null +++ b/packages/ui/assets/svg/harmony.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/ui/assets/svg/kcc.svg b/packages/ui/assets/svg/kcc.svg new file mode 100644 index 00000000..c6e686ce --- /dev/null +++ b/packages/ui/assets/svg/kcc.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/ui/assets/svg/kcs.svg b/packages/ui/assets/svg/kcs.svg index cc1e3da6..7d6ec624 100644 --- a/packages/ui/assets/svg/kcs.svg +++ b/packages/ui/assets/svg/kcs.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/matic.svg b/packages/ui/assets/svg/matic.svg new file mode 100644 index 00000000..164e11ff --- /dev/null +++ b/packages/ui/assets/svg/matic.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/ui/assets/svg/metis.svg b/packages/ui/assets/svg/metis.svg index 2d309508..9103d2db 100644 --- a/packages/ui/assets/svg/metis.svg +++ b/packages/ui/assets/svg/metis.svg @@ -1,3 +1,3 @@ - + diff --git a/packages/ui/assets/svg/olo.svg b/packages/ui/assets/svg/olo.svg new file mode 100644 index 00000000..965d52ec --- /dev/null +++ b/packages/ui/assets/svg/olo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/packages/ui/assets/svg/omg.svg b/packages/ui/assets/svg/omg.svg index d6307241..77aaba7f 100644 --- a/packages/ui/assets/svg/omg.svg +++ b/packages/ui/assets/svg/omg.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/assets/svg/one.svg b/packages/ui/assets/svg/one.svg new file mode 100644 index 00000000..d67330e9 --- /dev/null +++ b/packages/ui/assets/svg/one.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/ui/assets/svg/polygon.svg b/packages/ui/assets/svg/polygon.svg new file mode 100644 index 00000000..80e506ad --- /dev/null +++ b/packages/ui/assets/svg/polygon.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/ui/assets/svg/usdc.svg b/packages/ui/assets/svg/usdc.svg new file mode 100644 index 00000000..8c1a0773 --- /dev/null +++ b/packages/ui/assets/svg/usdc.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/ui/assets/svg/usdt.svg b/packages/ui/assets/svg/usdt.svg new file mode 100644 index 00000000..0b372bdd --- /dev/null +++ b/packages/ui/assets/svg/usdt.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/packages/ui/assets/svg/xau.svg b/packages/ui/assets/svg/xau.svg index 65d59ee1..95a79ed1 100644 --- a/packages/ui/assets/svg/xau.svg +++ b/packages/ui/assets/svg/xau.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/ui/components/Button.vue b/packages/ui/components/Button.vue new file mode 100644 index 00000000..b7a09f8d --- /dev/null +++ b/packages/ui/components/Button.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/packages/ui/components/CopyTooltip.vue b/packages/ui/components/CopyTooltip.vue index 1b2cbac3..07818e62 100644 --- a/packages/ui/components/CopyTooltip.vue +++ b/packages/ui/components/CopyTooltip.vue @@ -103,7 +103,7 @@ export default { .copy-tooltip { position: absolute; display: inline-block; - font-size: 16px; + font-size: var(--text-size); padding: 8px; border-radius: 4px; background-color: var(--bg); @@ -115,7 +115,7 @@ export default { .copy { padding: 16px; margin: -16px; - font-size: 12px; + font-size: var(--text-size-small); cursor: pointer; } diff --git a/packages/ui/components/DataFeedDescription.vue b/packages/ui/components/DataFeedDescription.vue new file mode 100644 index 00000000..118c2e63 --- /dev/null +++ b/packages/ui/components/DataFeedDescription.vue @@ -0,0 +1,65 @@ +{{ feedName }} + + + + + + + + + + + + diff --git a/packages/ui/components/DataFeedDetails.vue b/packages/ui/components/DataFeedDetails.vue index 4731ba66..c55aaf61 100644 --- a/packages/ui/components/DataFeedDetails.vue +++ b/packages/ui/components/DataFeedDetails.vue @@ -1,42 +1,41 @@