Merge commit 'f151eb81c812a62d1d5c57ee91620a3dd9ae5068' into simon/angular-universal
* commit 'f151eb81c812a62d1d5c57ee91620a3dd9ae5068': Upgrade angular from 10.0.4 to 10.2.3, typescript from 3.9.7 to 4.0.5 Modify /bisq/api/v1/markets/markets to only return active markets Remove unnecessary @types/axios dependency. Same npm fix for running `tsc` from `./node_modules` for backend Set npm to run `ng` and `tsc` binaries from `./node_modules/` path # Conflicts: # frontend/package-lock.json # frontend/package.json
This commit is contained in:
		
						commit
						f9c2bc1fb5
					
				
							
								
								
									
										18
									
								
								backend/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										18
									
								
								backend/package-lock.json
									
									
									
										generated
									
									
									
								
							@ -9,7 +9,6 @@
 | 
			
		||||
      "version": "2.0.0",
 | 
			
		||||
      "license": "MIT",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@types/axios": "^0.14.0",
 | 
			
		||||
        "axios": "^0.21.0",
 | 
			
		||||
        "express": "^4.17.1",
 | 
			
		||||
        "locutus": "^2.0.12",
 | 
			
		||||
@ -52,15 +51,6 @@
 | 
			
		||||
        "js-tokens": "^4.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/axios": {
 | 
			
		||||
      "version": "0.14.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz",
 | 
			
		||||
      "integrity": "sha1-7CMA++fX3d1+udOr+HmZlkyvzkY=",
 | 
			
		||||
      "deprecated": "This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed!",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "axios": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/body-parser": {
 | 
			
		||||
      "version": "1.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz",
 | 
			
		||||
@ -969,14 +959,6 @@
 | 
			
		||||
        "js-tokens": "^4.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@types/axios": {
 | 
			
		||||
      "version": "0.14.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/axios/-/axios-0.14.0.tgz",
 | 
			
		||||
      "integrity": "sha1-7CMA++fX3d1+udOr+HmZlkyvzkY=",
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "axios": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@types/body-parser": {
 | 
			
		||||
      "version": "1.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz",
 | 
			
		||||
 | 
			
		||||
@ -20,12 +20,13 @@
 | 
			
		||||
  ],
 | 
			
		||||
  "main": "index.ts",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "build": "tsc",
 | 
			
		||||
    "ng": "./node_modules/@angular/cli/bin/ng",
 | 
			
		||||
    "tsc": "./node_modules/typescript/bin/tsc",
 | 
			
		||||
    "build": "npm run tsc",
 | 
			
		||||
    "start": "node --max-old-space-size=4096 dist/index.js",
 | 
			
		||||
    "test": "echo \"Error: no test specified\" && exit 1"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@types/axios": "^0.14.0",
 | 
			
		||||
    "axios": "^0.21.0",
 | 
			
		||||
    "express": "^4.17.1",
 | 
			
		||||
    "locutus": "^2.0.12",
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,8 @@ import * as datetime from 'locutus/php/datetime';
 | 
			
		||||
class BisqMarketsApi {
 | 
			
		||||
  private cryptoCurrencyData: Currency[] = [];
 | 
			
		||||
  private fiatCurrencyData: Currency[] = [];
 | 
			
		||||
  private activeCryptoCurrencyData: Currency[] = [];
 | 
			
		||||
  private activeFiatCurrencyData: Currency[] = [];
 | 
			
		||||
  private offersData: OffersData[] = [];
 | 
			
		||||
  private tradesData: TradesData[] = [];
 | 
			
		||||
  private fiatCurrenciesIndexed: { [code: string]: true } = {};
 | 
			
		||||
@ -32,9 +34,11 @@ class BisqMarketsApi {
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  setCurrencyData(cryptoCurrency: Currency[], fiatCurrency: Currency[]) {
 | 
			
		||||
  setCurrencyData(cryptoCurrency: Currency[], fiatCurrency: Currency[], activeCryptoCurrency: Currency[], activeFiatCurrency: Currency[]) {
 | 
			
		||||
    this.cryptoCurrencyData = cryptoCurrency,
 | 
			
		||||
    this.fiatCurrencyData = fiatCurrency;
 | 
			
		||||
    this.fiatCurrencyData = fiatCurrency,
 | 
			
		||||
    this.activeCryptoCurrencyData = activeCryptoCurrency,
 | 
			
		||||
    this.activeFiatCurrencyData = activeFiatCurrency;
 | 
			
		||||
 | 
			
		||||
    this.fiatCurrenciesIndexed = {};
 | 
			
		||||
    this.allCurrenciesIndexed = {};
 | 
			
		||||
@ -56,7 +60,7 @@ class BisqMarketsApi {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getCurrencies(
 | 
			
		||||
    type: 'crypto' | 'fiat' | 'all' = 'all',
 | 
			
		||||
    type: 'crypto' | 'fiat' | 'active' | 'all' = 'all',
 | 
			
		||||
  ): Currencies {
 | 
			
		||||
    let currencies: Currency[];
 | 
			
		||||
 | 
			
		||||
@ -67,6 +71,9 @@ class BisqMarketsApi {
 | 
			
		||||
      case 'crypto':
 | 
			
		||||
        currencies = this.cryptoCurrencyData;
 | 
			
		||||
        break;
 | 
			
		||||
      case 'active':
 | 
			
		||||
        currencies = this.activeCryptoCurrencyData.concat(this.activeFiatCurrencyData);
 | 
			
		||||
        break;
 | 
			
		||||
      case 'all':
 | 
			
		||||
      default:
 | 
			
		||||
        currencies = this.cryptoCurrencyData.concat(this.fiatCurrencyData);
 | 
			
		||||
@ -136,9 +143,10 @@ class BisqMarketsApi {
 | 
			
		||||
 | 
			
		||||
  getMarkets(): Markets {
 | 
			
		||||
    const allCurrencies = this.getCurrencies();
 | 
			
		||||
    const activeCurrencies = this.getCurrencies('active');
 | 
			
		||||
    const markets = {};
 | 
			
		||||
 | 
			
		||||
    for (const currency of Object.keys(allCurrencies)) {
 | 
			
		||||
    for (const currency of Object.keys(activeCurrencies)) {
 | 
			
		||||
      if (allCurrencies[currency].code === 'BTC') {
 | 
			
		||||
        continue;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -8,6 +8,8 @@ class Bisq {
 | 
			
		||||
  private static FOLDER_WATCH_CHANGE_DETECTION_DEBOUNCE = 4000;
 | 
			
		||||
  private static MARKET_JSON_PATH = config.BISQ_MARKETS.DATA_PATH;
 | 
			
		||||
  private static MARKET_JSON_FILE_PATHS = {
 | 
			
		||||
    activeCryptoCurrency: '/active_crypto_currency_list.json',
 | 
			
		||||
    activeFiatCurrency: '/active_fiat_currency_list.json',
 | 
			
		||||
    cryptoCurrency: '/crypto_currency_list.json',
 | 
			
		||||
    fiatCurrency: '/fiat_currency_list.json',
 | 
			
		||||
    offers: '/offers_statistics.json',
 | 
			
		||||
@ -66,8 +68,10 @@ class Bisq {
 | 
			
		||||
      if (cryptoMtime > this.cryptoCurrencyLastMtime || fiatMtime > this.fiatCurrencyLastMtime) {
 | 
			
		||||
        const cryptoCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.cryptoCurrency);
 | 
			
		||||
        const fiatCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.fiatCurrency);
 | 
			
		||||
        const activeCryptoCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.activeCryptoCurrency);
 | 
			
		||||
        const activeFiatCurrencyData = await this.loadData<Currency[]>(Bisq.MARKET_JSON_FILE_PATHS.activeFiatCurrency);
 | 
			
		||||
        logger.debug('Updating Bisq Market Currency Data');
 | 
			
		||||
        bisqMarket.setCurrencyData(cryptoCurrencyData, fiatCurrencyData);
 | 
			
		||||
        bisqMarket.setCurrencyData(cryptoCurrencyData, fiatCurrencyData, activeCryptoCurrencyData, activeFiatCurrencyData);
 | 
			
		||||
        if (cryptoMtime > this.cryptoCurrencyLastMtime) {
 | 
			
		||||
          this.cryptoCurrencyLastMtime = cryptoMtime;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										66195
									
								
								frontend/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										66195
									
								
								frontend/package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -20,7 +20,8 @@
 | 
			
		||||
  ],
 | 
			
		||||
  "main": "index.ts",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "ng": "ng",
 | 
			
		||||
    "ng": "./node_modules/@angular/cli/bin/ng",
 | 
			
		||||
    "tsc": "./node_modules/typescript/bin/tsc",
 | 
			
		||||
    "serve": "ng serve --proxy-config proxy.conf.json",
 | 
			
		||||
    "start": "npm run generate-config && npm run sync-assets-dev && ng serve --proxy-config proxy.conf.json",
 | 
			
		||||
    "build": "npm run generate-config && ng build --prod && npm run sync-assets",
 | 
			
		||||
@ -36,16 +37,16 @@
 | 
			
		||||
    "prerender": "ng run mempool:prerender"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@angular/animations": "~10.2.2",
 | 
			
		||||
    "@angular/common": "~10.2.2",
 | 
			
		||||
    "@angular/compiler": "~10.2.2",
 | 
			
		||||
    "@angular/core": "~10.2.2",
 | 
			
		||||
    "@angular/forms": "~10.2.2",
 | 
			
		||||
    "@angular/localize": "^10.2.2",
 | 
			
		||||
    "@angular/platform-browser": "~10.2.2",
 | 
			
		||||
    "@angular/platform-browser-dynamic": "~10.2.2",
 | 
			
		||||
    "@angular/animations": "~10.2.3",
 | 
			
		||||
    "@angular/common": "~10.2.3",
 | 
			
		||||
    "@angular/compiler": "~10.2.3",
 | 
			
		||||
    "@angular/core": "~10.2.3",
 | 
			
		||||
    "@angular/forms": "~10.2.3",
 | 
			
		||||
    "@angular/localize": "^10.2.3",
 | 
			
		||||
    "@angular/platform-browser": "~10.2.3",
 | 
			
		||||
    "@angular/platform-browser-dynamic": "~10.2.3",
 | 
			
		||||
    "@angular/platform-server": "~10.2.2",
 | 
			
		||||
    "@angular/router": "~10.2.2",
 | 
			
		||||
    "@angular/router": "~10.2.3",
 | 
			
		||||
    "@fortawesome/angular-fontawesome": "^0.7.0",
 | 
			
		||||
    "@fortawesome/fontawesome-common-types": "^0.2.30",
 | 
			
		||||
    "@fortawesome/fontawesome-svg-core": "^1.2.30",
 | 
			
		||||
@ -71,7 +72,7 @@
 | 
			
		||||
    "@angular/cli": "~10.2.0",
 | 
			
		||||
    "@angular/compiler-cli": "~10.2.2",
 | 
			
		||||
    "@angular/language-service": "~10.2.2",
 | 
			
		||||
    "@nguniversal/builders": "^10.0.1",
 | 
			
		||||
    "@nguniversal/builders": "^10.1.0",
 | 
			
		||||
    "@types/express": "^4.17.0",
 | 
			
		||||
    "@types/jasmine": "~3.3.8",
 | 
			
		||||
    "@types/jasminewd2": "~2.0.3",
 | 
			
		||||
@ -88,6 +89,6 @@
 | 
			
		||||
    "protractor": "~7.0.0",
 | 
			
		||||
    "ts-node": "~7.0.0",
 | 
			
		||||
    "tslint": "~6.1.0",
 | 
			
		||||
    "typescript": "~3.9.7"
 | 
			
		||||
    "typescript": "~4.0.5"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user