diff --git a/backend/src/api/fiat-conversion.ts b/backend/src/api/fiat-conversion.ts index 954b5c606..89916c91d 100644 --- a/backend/src/api/fiat-conversion.ts +++ b/backend/src/api/fiat-conversion.ts @@ -2,10 +2,8 @@ import logger from '../logger'; import axios from 'axios'; class FiatConversion { - private tickers = { - 'BTCUSD': { - 'USD': 4110.78 - }, + private conversionRates = { + 'USD': 0 }; constructor() { } @@ -16,16 +14,19 @@ class FiatConversion { this.updateCurrency(); } - public getTickers() { - return this.tickers; + public getConversionRates() { + return this.conversionRates; } private async updateCurrency(): Promise { try { - const response = await axios.get('https://api.opennode.co/v1/rates'); - this.tickers = response.data.data; + const response = await axios.get('https://price.bisq.wiz.biz/getAllMarketPrices'); + const usd = response.data.data.find((item: any) => item.currencyCode === 'USD'); + this.conversionRates = { + 'USD': usd.price, + }; } catch (e) { - logger.err('Error updating currency from OpenNode: ' + e); + logger.err('Error updating fiat conversion rates: ' + e); } } } diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index b7f8b167e..76fb91583 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -126,7 +126,7 @@ class WebsocketHandler { 'vBytesPerSecond': memPool.getVBytesPerSecond(), 'lastDifficultyAdjustment': blocks.getLastDifficultyAdjustmentTime(), 'blocks': _blocks, - 'conversions': fiatConversion.getTickers()['BTCUSD'], + 'conversions': fiatConversion.getConversionRates(), 'mempool-blocks': mempoolBlocks.getMempoolBlocks(), 'transactions': memPool.getLatestTransactions(), 'git-commit': backendInfo.gitCommitHash, diff --git a/frontend/src/app/components/address/address.component.html b/frontend/src/app/components/address/address.component.html index 39ed2e22d..4552f9214 100644 --- a/frontend/src/app/components/address/address.component.html +++ b/frontend/src/app/components/address/address.component.html @@ -18,15 +18,15 @@ Total received - + Total sent - + Balance - () + () @@ -106,4 +106,8 @@ -
\ No newline at end of file +
+ + + Confidential + diff --git a/frontend/src/app/components/asset/asset.component.html b/frontend/src/app/components/asset/asset.component.html index b72c1c094..7f8703f72 100644 --- a/frontend/src/app/components/asset/asset.component.html +++ b/frontend/src/app/components/asset/asset.component.html @@ -24,7 +24,7 @@ Precision {{ assetContract[3] }} - + Issuer {{ assetContract[0] }} @@ -49,15 +49,15 @@ Issued amount - {{ formatAmount(asset.chain_stats.issued_amount, assetContract[3]) | number: '1.0-' + assetContract[3] }} {{ assetContract[1] }} + {{ formatAmount(asset.chain_stats.issued_amount, assetContract[3]) | number: '1.0-' + assetContract[3] }} {{ assetContract[1] }} Burned amount - {{ formatAmount(asset.chain_stats.burned_amount, assetContract[3]) | number: '1.0-' + assetContract[3] }} {{ assetContract[1] }} + {{ formatAmount(asset.chain_stats.burned_amount, assetContract[3]) | number: '1.0-' + assetContract[3] }} {{ assetContract[1] }} Circulating amount - {{ formatAmount(asset.chain_stats.issued_amount - asset.chain_stats.burned_amount, assetContract[3]) | number: '1.0-' + assetContract[3] }} {{ assetContract[1] }} + {{ formatAmount(asset.chain_stats.issued_amount - asset.chain_stats.burned_amount, assetContract[3]) | number: '1.0-' + assetContract[3] }} {{ assetContract[1] }} Circulating amount @@ -137,4 +137,8 @@ -
\ No newline at end of file +
+ + + Confidential + diff --git a/frontend/src/app/components/asset/asset.component.ts b/frontend/src/app/components/asset/asset.component.ts index 13775ba7c..0c80ec683 100644 --- a/frontend/src/app/components/asset/asset.component.ts +++ b/frontend/src/app/components/asset/asset.component.ts @@ -11,7 +11,7 @@ import { of, merge, Subscription, combineLatest } from 'rxjs'; import { SeoService } from 'src/app/services/seo.service'; import { environment } from 'src/environments/environment'; import { AssetsService } from 'src/app/services/assets.service'; -import { formatNumber, moveDec } from 'src/app/bitcoin.utils'; +import { moveDec } from 'src/app/bitcoin.utils'; @Component({ selector: 'app-asset', @@ -23,6 +23,7 @@ export class AssetComponent implements OnInit, OnDestroy { nativeAssetId = environment.nativeAssetId; asset: Asset; + blindedIssuance: boolean; assetContract: any; assetString: string; isLoadingAsset = true; @@ -98,6 +99,10 @@ export class AssetComponent implements OnInit, OnDestroy { switchMap(([asset, assetsData]) => { this.asset = asset; this.assetContract = assetsData[this.asset.asset_id]; + if (!this.assetContract) { + this.assetContract = [null, '?', 'Unknown', 0]; + } + this.blindedIssuance = this.asset.chain_stats.has_blinded_issuances || this.asset.mempool_stats.has_blinded_issuances; this.isNativeAsset = asset.asset_id === this.nativeAssetId; this.updateChainStats(); this.websocketService.startTrackAsset(asset.asset_id); diff --git a/frontend/src/app/components/search-form/search-form.component.html b/frontend/src/app/components/search-form/search-form.component.html index 78fcd8078..f71ac0ec1 100644 --- a/frontend/src/app/components/search-form/search-form.component.html +++ b/frontend/src/app/components/search-form/search-form.component.html @@ -4,7 +4,7 @@
- +
\ No newline at end of file diff --git a/frontend/src/app/components/search-form/search-form.component.ts b/frontend/src/app/components/search-form/search-form.component.ts index 3bae9e803..c458d5a00 100644 --- a/frontend/src/app/components/search-form/search-form.component.ts +++ b/frontend/src/app/components/search-form/search-form.component.ts @@ -17,6 +17,7 @@ import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap'; export class SearchFormComponent implements OnInit { network = ''; assets: object = {}; + isSearching = false; searchForm: FormGroup; @Output() searchTriggered = new EventEmitter(); @@ -74,25 +75,36 @@ export class SearchFormComponent implements OnInit { search() { const searchText = this.searchForm.value.searchText.trim(); if (searchText) { + this.isSearching = true; if (this.regexAddress.test(searchText)) { - this.router.navigate([(this.network ? '/' + this.network : '') + '/address/', searchText]); - this.searchTriggered.emit(); + this.navigate('/address/', searchText); } else if (this.regexBlockhash.test(searchText) || this.regexBlockheight.test(searchText)) { - this.router.navigate([(this.network ? '/' + this.network : '') + '/block/', searchText]); - this.searchTriggered.emit(); + this.navigate('/block/', searchText); } else if (this.regexTransaction.test(searchText)) { - if (this.network === 'liquid' && this.assets[searchText]) { - this.router.navigate([(this.network ? '/' + this.network : '') + '/asset/', searchText]); + if (this.network === 'liquid') { + if (this.assets[searchText]) { + this.navigate('/asset/', searchText); + } + this.electrsApiService.getAsset$(searchText) + .subscribe( + () => { this.navigate('/asset/', searchText); }, + () => { this.navigate('/tx/', searchText); } + ); } else { - this.router.navigate([(this.network ? '/' + this.network : '') + '/tx/', searchText]); + this.navigate('/tx/', searchText); } - this.searchTriggered.emit(); } else { - return; + this.isSearching = false; } - this.searchForm.setValue({ - searchText: '', - }); } } + + navigate(url: string, searchText: string) { + this.router.navigate([(this.network ? '/' + this.network : '') + url, searchText]); + this.searchTriggered.emit(); + this.searchForm.setValue({ + searchText: '', + }); + this.isSearching = false; + } } diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.html b/frontend/src/app/components/transactions-list/transactions-list.component.html index 8290c2422..bf248e301 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.html +++ b/frontend/src/app/components/transactions-list/transactions-list.component.html @@ -129,7 +129,7 @@ - OP_RETURN {{ vout.scriptpubkey_asm | hex2ascii }} + OP_RETURN {{ vout.scriptpubkey_asm | hex2ascii }} {{ vout.scriptpubkey_type | scriptpubkeyType }} diff --git a/production/mempool-upgrade-all b/production/mempool-upgrade-all index 029ff7d79..b8fdac452 100755 --- a/production/mempool-upgrade-all +++ b/production/mempool-upgrade-all @@ -14,21 +14,21 @@ source "$NVM_DIR/nvm.sh" REPO=origin BRANCH=master -TAG="${REPO}/${BRANCH}" +TAG="${BRANCH}" [ ! -z "$1" ] && TAG=$1 echo "upgrading mempool to ${TAG}" | wall cd "$HOME/mempool" git fetch "${REPO}" -git reset --hard "${TAG}" +git reset --hard "${REPO}/${TAG}" cd "$HOME/" for site in mainnet liquid testnet bisq do cd "$HOME/${site}" git fetch "${REPO}" - git reset --hard "${TAG}" + git reset --hard "${REPO}/${TAG}" hash=$(git rev-parse HEAD) if [ "${site}" = "mainnet" ]