Skip to content

Commit

Permalink
Merge pull request #156 from Synthetixio/updating-types-for-queries-p…
Browse files Browse the repository at this point in the history
…ackage

added new contract interface types
  • Loading branch information
fritzschoff authored Jan 27, 2022
2 parents cdd6a45 + 48216f6 commit ea4cb65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/queries/src/queries/misc/useTokenListQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ import { useQuery, UseQueryOptions } from 'react-query';
import axios from 'axios';
import keyBy from 'lodash/keyBy';

import { TokenListQueryResponse, TokenListResponse } from '../../types';
import { Token, TokenListQueryResponse, TokenListResponse } from '../../types';
import { CryptoCurrency, ETH_ADDRESS } from '../../currency';
import { QueryContext } from '../../context';
import { NetworkIdByName } from '@synthetixio/contracts-interface';

const ether = {
address: ETH_ADDRESS,
chainId: 1,
chainId: NetworkIdByName.mainnet,
decimals: 18,
logoURI: '',
name: 'Ethereum',
symbol: CryptoCurrency.ETH,
tags: [],
};
} as Token;

const useTokenListQuery = (
_: QueryContext,
Expand All @@ -25,7 +26,6 @@ const useTokenListQuery = (
['misc', 'tokenList', tokenListUrl],
async () => {
const response = await axios.get<TokenListResponse>(tokenListUrl);

const tokens = [ether, ...response.data.tokens];

return {
Expand Down
8 changes: 4 additions & 4 deletions packages/queries/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Wei from '@synthetixio/wei';
import { CurrencyKey } from '@synthetixio/contracts-interface';
import { CurrencyKey, NetworkId, NetworkName } from '@synthetixio/contracts-interface';
import { BigNumber } from 'ethers';

export type GasPrice = {
Expand Down Expand Up @@ -103,7 +103,7 @@ export type GlobalStakingInfo = {

export type Token = {
address: string;
chainId: number;
chainId: NetworkId;
decimals: number;
logoURI: string;
name: string;
Expand Down Expand Up @@ -140,7 +140,7 @@ export type SpaceData = {
};
members: string[];
name: string;
network: string;
network: NetworkName;
skin: string;
strategies: SpaceStrategy[];
symbol: string;
Expand All @@ -161,7 +161,7 @@ export type Proposal = {
author: string;
created: number;
space: SpaceData;
network: string;
network: NetworkName;
strategies: SpaceStrategy[];
plugins: any;
title: string;
Expand Down

0 comments on commit ea4cb65

Please sign in to comment.