diff --git a/backend/src/api/bitcoin/bitcoin-api.ts b/backend/src/api/bitcoin/bitcoin-api.ts index 48368a128..e52aaffaf 100644 --- a/backend/src/api/bitcoin/bitcoin-api.ts +++ b/backend/src/api/bitcoin/bitcoin-api.ts @@ -192,12 +192,9 @@ class BitcoinApi implements AbstractBitcoinApi { } if (addPrevout) { - if (transaction.confirmations) { - esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction); - } else { - esploraTransaction = await this.$appendMempoolFeeData(esploraTransaction); - esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction); - } + esploraTransaction = await this.$calculateFeeFromInputs(esploraTransaction); + } else if (!transaction.confirmations) { + esploraTransaction = await this.$appendMempoolFeeData(esploraTransaction); } return esploraTransaction; diff --git a/backend/src/routes.ts b/backend/src/routes.ts index c39d3ec56..d65b4f836 100644 --- a/backend/src/routes.ts +++ b/backend/src/routes.ts @@ -645,7 +645,7 @@ class Routes { res.header('Pragma', 'public'); res.header('Cache-control', 'public'); res.header('X-total-count', blockCount.toString()); - res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString()); + res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString()); res.json(blockFees); } catch (e) { res.status(500).send(e instanceof Error ? e.message : e); @@ -659,7 +659,7 @@ class Routes { res.header('Pragma', 'public'); res.header('Cache-control', 'public'); res.header('X-total-count', blockCount.toString()); - res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString()); + res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString()); res.json(blockRewards); } catch (e) { res.status(500).send(e instanceof Error ? e.message : e); @@ -672,7 +672,7 @@ class Routes { const oldestIndexedBlockTimestamp = await BlocksRepository.$oldestBlockTimestamp(); res.header('Pragma', 'public'); res.header('Cache-control', 'public'); - res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString()); + res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString()); res.json({ oldestIndexedBlockTimestamp: oldestIndexedBlockTimestamp, blockFeeRates: blockFeeRates, @@ -690,7 +690,7 @@ class Routes { res.header('Pragma', 'public'); res.header('Cache-control', 'public'); res.header('X-total-count', blockCount.toString()); - res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString()); + res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString()); res.json({ sizes: blockSizes, weights: blockWeights diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 2eaf7e277..672d68686 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -1,43 +1,211 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { Routes, RouterModule, PreloadAllModules } from '@angular/router'; import { StartComponent } from './components/start/start.component'; import { TransactionComponent } from './components/transaction/transaction.component'; import { BlockComponent } from './components/block/block.component'; import { AddressComponent } from './components/address/address.component'; import { MasterPageComponent } from './components/master-page/master-page.component'; import { AboutComponent } from './components/about/about.component'; -import { TelevisionComponent } from './components/television/television.component'; -import { StatisticsComponent } from './components/statistics/statistics.component'; -import { MempoolBlockComponent } from './components/mempool-block/mempool-block.component'; -import { AssetComponent } from './components/asset/asset.component'; -import { AssetsNavComponent } from './components/assets/assets-nav/assets-nav.component'; import { StatusViewComponent } from './components/status-view/status-view.component'; -import { DashboardComponent } from './dashboard/dashboard.component'; import { LatestBlocksComponent } from './components/latest-blocks/latest-blocks.component'; import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component'; import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component'; import { TrademarkPolicyComponent } from './components/trademark-policy/trademark-policy.component'; import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component'; import { SponsorComponent } from './components/sponsor/sponsor.component'; -import { LiquidMasterPageComponent } from './components/liquid-master-page/liquid-master-page.component'; import { PushTransactionComponent } from './components/push-transaction/push-transaction.component'; -import { PoolRankingComponent } from './components/pool-ranking/pool-ranking.component'; +import { BlocksList } from './components/blocks-list/blocks-list.component'; +import { LiquidMasterPageComponent } from './components/liquid-master-page/liquid-master-page.component'; import { AssetGroupComponent } from './components/assets/asset-group/asset-group.component'; import { AssetsFeaturedComponent } from './components/assets/assets-featured/assets-featured.component'; import { AssetsComponent } from './components/assets/assets.component'; -import { PoolComponent } from './components/pool/pool.component'; -import { MiningDashboardComponent } from './components/mining-dashboard/mining-dashboard.component'; -import { HashrateChartComponent } from './components/hashrate-chart/hashrate-chart.component'; -import { HashrateChartPoolsComponent } from './components/hashrates-chart-pools/hashrate-chart-pools.component'; -import { MiningStartComponent } from './components/mining-start/mining-start.component'; -import { GraphsComponent } from './components/graphs/graphs.component'; -import { BlocksList } from './components/blocks-list/blocks-list.component'; -import { BlockFeesGraphComponent } from './components/block-fees-graph/block-fees-graph.component'; -import { BlockRewardsGraphComponent } from './components/block-rewards-graph/block-rewards-graph.component'; -import { BlockFeeRatesGraphComponent } from './components/block-fee-rates-graph/block-fee-rates-graph.component'; -import { BlockSizesWeightsGraphComponent } from './components/block-sizes-weights-graph/block-sizes-weights-graph.component'; +import { AssetComponent } from './components/asset/asset.component'; +import { AssetsNavComponent } from './components/assets/assets-nav/assets-nav.component'; let routes: Routes = [ + { + path: 'testnet', + children: [ + { + path: '', + pathMatch: 'full', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '', + component: MasterPageComponent, + children: [ + { + path: 'tx/push', + component: PushTransactionComponent, + }, + { + path: 'blocks', + component: LatestBlocksComponent, + }, + { + path: 'about', + component: AboutComponent, + }, + { + path: 'mining/blocks', + component: BlocksList, + }, + { + path: 'terms-of-service', + component: TermsOfServiceComponent + }, + { + path: 'privacy-policy', + component: PrivacyPolicyComponent + }, + { + path: 'trademark-policy', + component: TrademarkPolicyComponent + }, + { + path: 'address/:id', + children: [], + component: AddressComponent + }, + { + path: 'tx', + component: StartComponent, + children: [ + { + path: ':id', + component: TransactionComponent + }, + ], + }, + { + path: 'block', + component: StartComponent, + children: [ + { + path: ':id', + component: BlockComponent + }, + ], + }, + { + path: 'docs', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + { + path: 'api', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + ], + }, + { + path: 'status', + component: StatusViewComponent + }, + { + path: '', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '**', + redirectTo: '/testnet' + }, + ] + }, + { + path: 'signet', + children: [ + { + path: '', + pathMatch: 'full', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '', + component: MasterPageComponent, + children: [ + { + path: 'tx/push', + component: PushTransactionComponent, + }, + { + path: 'blocks', + component: LatestBlocksComponent, + }, + { + path: 'about', + component: AboutComponent, + }, + { + path: 'mining/blocks', + component: BlocksList, + }, + { + path: 'terms-of-service', + component: TermsOfServiceComponent + }, + { + path: 'privacy-policy', + component: PrivacyPolicyComponent + }, + { + path: 'trademark-policy', + component: TrademarkPolicyComponent + }, + { + path: 'address/:id', + children: [], + component: AddressComponent + }, + { + path: 'tx', + component: StartComponent, + children: [ + { + path: ':id', + component: TransactionComponent + }, + ], + }, + { + path: 'block', + component: StartComponent, + children: [ + { + path: ':id', + component: BlockComponent + }, + ], + }, + { + path: 'docs', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + { + path: 'api', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + ], + }, + { + path: 'status', + component: StatusViewComponent + }, + { + path: '', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '**', + redirectTo: '/signet' + }, + ] + }, + { + path: '', + pathMatch: 'full', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, { path: '', component: MasterPageComponent, @@ -46,109 +214,17 @@ let routes: Routes = [ path: 'tx/push', component: PushTransactionComponent, }, - { - path: '', - component: StartComponent, - children: [ - { - path: '', - component: DashboardComponent, - }, - { - path: 'tx/:id', - component: TransactionComponent - }, - { - path: 'block/:id', - component: BlockComponent - }, - { - path: 'mempool-block/:id', - component: MempoolBlockComponent - }, - { - path: 'mining', - component: MiningDashboardComponent, - }, - ], - }, { path: 'blocks', component: LatestBlocksComponent, }, - { - path: 'mining', - component: MiningStartComponent, - children: [ - { - path: 'blocks', - component: BlocksList, - }, - { - path: 'pool', - children: [ - { - path: ':slug', - component: PoolComponent, - }, - ] - }, - ] - }, - { - path: 'graphs', - component: GraphsComponent, - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'mempool', - }, - { - path: 'mempool', - component: StatisticsComponent, - }, - { - path: 'mining/hashrate-difficulty', - component: HashrateChartComponent, - }, - { - path: 'mining/pools-dominance', - component: HashrateChartPoolsComponent, - }, - { - path: 'mining/pools', - component: PoolRankingComponent, - }, - { - path: 'mining/block-fees', - component: BlockFeesGraphComponent, - }, - { - path: 'mining/block-rewards', - component: BlockRewardsGraphComponent, - }, - { - path: 'mining/block-fee-rates', - component: BlockFeeRatesGraphComponent, - }, - { - path: 'mining/block-sizes-weights', - component: BlockSizesWeightsGraphComponent, - }, - ], - }, { path: 'about', component: AboutComponent, }, { - path: 'docs', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'api', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + path: 'mining/blocks', + component: BlocksList, }, { path: 'terms-of-service', @@ -167,276 +243,36 @@ let routes: Routes = [ children: [], component: AddressComponent }, + { + path: 'tx', + component: StartComponent, + children: [ + { + path: ':id', + component: TransactionComponent + }, + ], + }, + { + path: 'block', + component: StartComponent, + children: [ + { + path: ':id', + component: BlockComponent + }, + ], + }, + { + path: 'docs', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + { + path: 'api', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, ], }, - { - path: 'testnet', - children: [ - { - path: '', - component: MasterPageComponent, - children: [ - { - path: 'tx/push', - component: PushTransactionComponent, - }, - { - path: '', - component: StartComponent, - children: [ - { - path: '', - component: DashboardComponent - }, - { - path: 'tx/:id', - component: TransactionComponent - }, - { - path: 'block/:id', - component: BlockComponent - }, - { - path: 'mempool-block/:id', - component: MempoolBlockComponent - }, - { - path: 'mining', - component: MiningDashboardComponent, - }, - ], - }, - { - path: 'blocks', - component: LatestBlocksComponent, - }, - { - path: 'mining', - component: MiningStartComponent, - children: [ - { - path: 'blocks', - component: BlocksList, - }, - { - path: 'pool', - children: [ - { - path: ':slug', - component: PoolComponent, - }, - ] - }, - ] - }, - { - path: 'graphs', - component: GraphsComponent, - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'mempool', - }, - { - path: 'mempool', - component: StatisticsComponent, - }, - { - path: 'mining/hashrate-difficulty', - component: HashrateChartComponent, - }, - { - path: 'mining/pools-dominance', - component: HashrateChartPoolsComponent, - }, - { - path: 'mining/pools', - component: PoolRankingComponent, - }, - { - path: 'mining/block-fees', - component: BlockFeesGraphComponent, - }, - { - path: 'mining/block-rewards', - component: BlockRewardsGraphComponent, - }, - { - path: 'mining/block-fee-rates', - component: BlockFeeRatesGraphComponent, - }, - { - path: 'mining/block-sizes-weights', - component: BlockSizesWeightsGraphComponent, - }, - ] - }, - { - path: 'address/:id', - children: [], - component: AddressComponent - }, - { - path: 'docs', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'api', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - ], - }, - { - path: 'tv', - component: TelevisionComponent - }, - { - path: 'status', - component: StatusViewComponent - }, - { - path: '**', - redirectTo: '/testnet' - }, - ] - }, - { - path: 'signet', - children: [ - { - path: '', - component: MasterPageComponent, - children: [ - { - path: 'tx/push', - component: PushTransactionComponent, - }, - { - path: '', - component: StartComponent, - children: [ - { - path: '', - component: DashboardComponent - }, - { - path: 'tx/:id', - component: TransactionComponent - }, - { - path: 'block/:id', - component: BlockComponent - }, - { - path: 'mempool-block/:id', - component: MempoolBlockComponent - }, - { - path: 'mining', - component: MiningDashboardComponent, - }, - ], - }, - { - path: 'blocks', - component: LatestBlocksComponent, - }, - { - path: 'mining', - component: MiningStartComponent, - children: [ - { - path: 'blocks', - component: BlocksList, - }, - { - path: 'pool', - children: [ - { - path: ':slug', - component: PoolComponent, - }, - ] - }, - ] - }, - { - path: 'graphs', - component: GraphsComponent, - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'mempool', - }, - { - path: 'mempool', - component: StatisticsComponent, - }, - { - path: 'mining/hashrate-difficulty', - component: HashrateChartComponent, - }, - { - path: 'mining/pools-dominance', - component: HashrateChartPoolsComponent, - }, - { - path: 'mining/pools', - component: PoolRankingComponent, - }, - { - path: 'mining/block-fees', - component: BlockFeesGraphComponent, - }, - { - path: 'mining/block-rewards', - component: BlockRewardsGraphComponent, - }, - { - path: 'mining/block-fee-rates', - component: BlockFeeRatesGraphComponent, - }, - { - path: 'mining/block-sizes-weights', - component: BlockSizesWeightsGraphComponent, - }, - ] - }, - { - path: 'address/:id', - children: [], - component: AddressComponent - }, - { - path: 'docs', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'api', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - ], - }, - { - path: 'tv', - component: TelevisionComponent - }, - { - path: 'status', - component: StatusViewComponent - }, - { - path: '**', - redirectTo: '/signet' - }, - ] - }, - { - path: 'tv', - component: TelevisionComponent, - }, { path: 'status', component: StatusViewComponent @@ -445,6 +281,10 @@ let routes: Routes = [ path: 'sponsor', component: SponsorComponent, }, + { + path: '', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, { path: '**', redirectTo: '' @@ -464,244 +304,241 @@ if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'bisq') { } if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') { - routes = [{ - path: '', - component: LiquidMasterPageComponent, - children: [ - { - path: '', - component: StartComponent, - children: [ - { - path: '', - component: DashboardComponent - }, - { - path: 'tx/push', - component: PushTransactionComponent, - }, - { - path: 'tx/:id', - component: TransactionComponent - }, - { - path: 'block/:id', - component: BlockComponent - }, - { - path: 'mempool-block/:id', - component: MempoolBlockComponent - }, - ], - }, - { - path: 'blocks', - component: LatestBlocksComponent, - }, - { - path: 'graphs', - component: GraphsComponent, - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'mempool', - }, - { - path: 'mempool', - component: StatisticsComponent, - } - ] - }, - { - path: 'address/:id', - component: AddressComponent - }, - { - path: 'assets', - component: AssetsNavComponent, - children: [ - { - path: 'featured', - component: AssetsFeaturedComponent, - }, - { - path: 'all', - component: AssetsComponent, - }, - { - path: 'asset/:id', - component: AssetComponent - }, - { - path: 'group/:id', - component: AssetGroupComponent - }, - { - path: '**', - redirectTo: 'featured' - } - ] - }, - { - path: 'docs', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'api', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'about', - component: AboutComponent, - }, - { - path: 'terms-of-service', - component: TermsOfServiceComponent - }, - { - path: 'privacy-policy', - component: PrivacyPolicyComponent - }, - { - path: 'trademark-policy', - component: TrademarkPolicyComponent - }, - ], - }, - { - path: 'testnet', - children: [ - { - path: '', - component: LiquidMasterPageComponent, - children: [ - { - path: '', - component: StartComponent, + routes = [ + { + path: 'testnet', + children: [ + { + path: '', + pathMatch: 'full', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '', + component: LiquidMasterPageComponent, + children: [ + { + path: 'tx/push', + component: PushTransactionComponent, + }, + { + path: 'blocks', + component: LatestBlocksComponent, + }, + { + path: 'about', + component: AboutComponent, + }, + { + path: 'mining/blocks', + component: BlocksList, + }, + { + path: 'terms-of-service', + component: TermsOfServiceComponent + }, + { + path: 'privacy-policy', + component: PrivacyPolicyComponent + }, + { + path: 'trademark-policy', + component: TrademarkPolicyComponent + }, + { + path: 'address/:id', + children: [], + component: AddressComponent + }, + { + path: 'tx', + component: StartComponent, + children: [ + { + path: ':id', + component: TransactionComponent + }, + ], + }, + { + path: 'block', + component: StartComponent, + children: [ + { + path: ':id', + component: BlockComponent + }, + ], + }, + { + path: 'assets', + component: AssetsNavComponent, + children: [ + { + path: 'all', + component: AssetsComponent, + }, + { + path: 'asset/:id', + component: AssetComponent + }, + { + path: 'group/:id', + component: AssetGroupComponent + }, + { + path: '**', + redirectTo: 'all' + } + ] + }, + { + path: 'docs', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + { + path: 'api', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + ], + }, + { + path: 'status', + component: StatusViewComponent + }, + { + path: '', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '**', + redirectTo: '/signet' + }, + ] + }, + { + path: '', + pathMatch: 'full', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '', + component: LiquidMasterPageComponent, + children: [ + { + path: 'tx/push', + component: PushTransactionComponent, + }, + { + path: 'blocks', + component: LatestBlocksComponent, + }, + { + path: 'about', + component: AboutComponent, + }, + { + path: 'mining/blocks', + component: BlocksList, + }, + { + path: 'terms-of-service', + component: TermsOfServiceComponent + }, + { + path: 'privacy-policy', + component: PrivacyPolicyComponent + }, + { + path: 'trademark-policy', + component: TrademarkPolicyComponent + }, + { + path: 'address/:id', + children: [], + component: AddressComponent + }, + { + path: 'tx', + component: StartComponent, + children: [ + { + path: ':id', + component: TransactionComponent + }, + ], + }, + { + path: 'block', + component: StartComponent, children: [ - { - path: '', - component: DashboardComponent - }, - { - path: 'tx/push', - component: PushTransactionComponent, - }, - { - path: 'tx/:id', - component: TransactionComponent - }, - { - path: 'block/:id', - component: BlockComponent - }, - { - path: 'mempool-block/:id', - component: MempoolBlockComponent - }, - ], - }, - { - path: 'blocks', - component: LatestBlocksComponent, - }, - { - path: 'graphs', - component: GraphsComponent, - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'mempool', - }, - { - path: 'mempool', - component: StatisticsComponent, - } - ] - }, - { - path: 'address/:id', - component: AddressComponent - }, - { - path: 'assets', - component: AssetsNavComponent, - children: [ - { - path: 'all', - component: AssetsComponent, - }, - { - path: 'asset/:id', - component: AssetComponent - }, - { - path: 'group/:id', - component: AssetGroupComponent - }, - { - path: '**', - redirectTo: 'all' - } - ] - }, - { - path: 'docs', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'api', - loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) - }, - { - path: 'about', - component: AboutComponent, - }, - { - path: 'terms-of-service', - component: TermsOfServiceComponent - }, - { - path: 'privacy-policy', - component: PrivacyPolicyComponent - }, - { - path: 'trademark-policy', - component: TrademarkPolicyComponent - }, - ], - }, - { - path: 'tv', - component: TelevisionComponent - }, - { - path: 'status', - component: StatusViewComponent - }, - ] - }, - { - path: 'tv', - component: TelevisionComponent - }, - { - path: 'status', - component: StatusViewComponent - }, - { - path: '**', - redirectTo: '/testnet' - }]; + { + path: ':id', + component: BlockComponent + }, + ], + }, + { + path: 'assets', + component: AssetsNavComponent, + children: [ + { + path: 'featured', + component: AssetsFeaturedComponent, + }, + { + path: 'all', + component: AssetsComponent, + }, + { + path: 'asset/:id', + component: AssetComponent + }, + { + path: 'group/:id', + component: AssetGroupComponent + }, + { + path: '**', + redirectTo: 'featured' + } + ] + }, + { + path: 'docs', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + { + path: 'api', + loadChildren: () => import('./docs/docs.module').then(m => m.DocsModule) + }, + ], + }, + { + path: 'status', + component: StatusViewComponent + }, + { + path: 'sponsor', + component: SponsorComponent, + }, + { + path: '', + loadChildren: () => import('./graphs/graphs.module').then(m => m.GraphsModule) + }, + { + path: '**', + redirectTo: '' + }, + ]; } @NgModule({ imports: [RouterModule.forRoot(routes, { initialNavigation: 'enabled', scrollPositionRestoration: 'enabled', - anchorScrolling: 'enabled' + anchorScrolling: 'enabled', + preloadingStrategy: PreloadAllModules })], }) export class AppRoutingModule { } diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 4b4e9eba9..8845f4255 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -2,141 +2,23 @@ import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-bro import { NgModule } from '@angular/core'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { NgxEchartsModule } from 'ngx-echarts'; - import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './components/app/app.component'; - -import { StartComponent } from './components/start/start.component'; import { ElectrsApiService } from './services/electrs-api.service'; -import { TransactionComponent } from './components/transaction/transaction.component'; -import { TransactionsListComponent } from './components/transactions-list/transactions-list.component'; import { StateService } from './services/state.service'; -import { BlockComponent } from './components/block/block.component'; -import { AddressComponent } from './components/address/address.component'; -import { SearchFormComponent } from './components/search-form/search-form.component'; -import { LatestBlocksComponent } from './components/latest-blocks/latest-blocks.component'; import { WebsocketService } from './services/websocket.service'; -import { AddressLabelsComponent } from './components/address-labels/address-labels.component'; -import { MasterPageComponent } from './components/master-page/master-page.component'; -import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component'; -import { LiquidMasterPageComponent } from './components/liquid-master-page/liquid-master-page.component'; -import { AboutComponent } from './components/about/about.component'; -import { TelevisionComponent } from './components/television/television.component'; -import { StatisticsComponent } from './components/statistics/statistics.component'; -import { FooterComponent } from './components/footer/footer.component'; import { AudioService } from './services/audio.service'; -import { MempoolBlockComponent } from './components/mempool-block/mempool-block.component'; -import { FeeDistributionGraphComponent } from './components/fee-distribution-graph/fee-distribution-graph.component'; -import { IncomingTransactionsGraphComponent } from './components/incoming-transactions-graph/incoming-transactions-graph.component'; -import { TimeSpanComponent } from './components/time-span/time-span.component'; import { SeoService } from './services/seo.service'; -import { MempoolGraphComponent } from './components/mempool-graph/mempool-graph.component'; -import { PoolRankingComponent } from './components/pool-ranking/pool-ranking.component'; -import { PoolComponent } from './components/pool/pool.component'; -import { LbtcPegsGraphComponent } from './components/lbtc-pegs-graph/lbtc-pegs-graph.component'; -import { AssetComponent } from './components/asset/asset.component'; -import { AssetsComponent } from './components/assets/assets.component'; -import { AssetsNavComponent } from './components/assets/assets-nav/assets-nav.component'; -import { StatusViewComponent } from './components/status-view/status-view.component'; import { SharedModule } from './shared/shared.module'; -import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap'; -import { FeesBoxComponent } from './components/fees-box/fees-box.component'; -import { DashboardComponent } from './dashboard/dashboard.component'; -import { DifficultyComponent } from './components/difficulty/difficulty.component'; -import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome'; -import { faFilter, faAngleDown, faAngleUp, faAngleRight, faAngleLeft, faBolt, faChartArea, faCogs, faCubes, faHammer, faDatabase, faExchangeAlt, faInfoCircle, - faLink, faList, faSearch, faCaretUp, faCaretDown, faTachometerAlt, faThList, faTint, faTv, faAngleDoubleDown, faSortUp, faAngleDoubleUp, faChevronDown, - faFileAlt, faRedoAlt, faArrowAltCircleRight, faExternalLinkAlt, faBook, faListUl, faDownload } from '@fortawesome/free-solid-svg-icons'; -import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component'; -import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component'; -import { TrademarkPolicyComponent } from './components/trademark-policy/trademark-policy.component'; import { StorageService } from './services/storage.service'; import { HttpCacheInterceptor } from './services/http-cache.interceptor'; import { LanguageService } from './services/language.service'; -import { SponsorComponent } from './components/sponsor/sponsor.component'; -import { PushTransactionComponent } from './components/push-transaction/push-transaction.component'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { AssetsFeaturedComponent } from './components/assets/assets-featured/assets-featured.component'; -import { AssetGroupComponent } from './components/assets/asset-group/asset-group.component'; -import { AssetCirculationComponent } from './components/asset-circulation/asset-circulation.component'; -import { MiningDashboardComponent } from './components/mining-dashboard/mining-dashboard.component'; -import { HashrateChartComponent } from './components/hashrate-chart/hashrate-chart.component'; -import { HashrateChartPoolsComponent } from './components/hashrates-chart-pools/hashrate-chart-pools.component'; -import { MiningStartComponent } from './components/mining-start/mining-start.component'; -import { AmountShortenerPipe } from './shared/pipes/amount-shortener.pipe'; import { ShortenStringPipe } from './shared/pipes/shorten-string-pipe/shorten-string.pipe'; import { CapAddressPipe } from './shared/pipes/cap-address-pipe/cap-address-pipe'; -import { GraphsComponent } from './components/graphs/graphs.component'; -import { DifficultyAdjustmentsTable } from './components/difficulty-adjustments-table/difficulty-adjustments-table.components'; -import { BlocksList } from './components/blocks-list/blocks-list.component'; -import { RewardStatsComponent } from './components/reward-stats/reward-stats.component'; -import { DataCyDirective } from './data-cy.directive'; -import { BlockFeesGraphComponent } from './components/block-fees-graph/block-fees-graph.component'; -import { BlockRewardsGraphComponent } from './components/block-rewards-graph/block-rewards-graph.component'; -import { BlockFeeRatesGraphComponent } from './components/block-fee-rates-graph/block-fee-rates-graph.component'; -import { LoadingIndicatorComponent } from './components/loading-indicator/loading-indicator.component'; -import { IndexingProgressComponent } from './components/indexing-progress/indexing-progress.component'; -import { BlockSizesWeightsGraphComponent } from './components/block-sizes-weights-graph/block-sizes-weights-graph.component'; @NgModule({ declarations: [ AppComponent, - AboutComponent, - MasterPageComponent, - BisqMasterPageComponent, - LiquidMasterPageComponent, - TelevisionComponent, - StartComponent, - StatisticsComponent, - TransactionComponent, - BlockComponent, - TransactionsListComponent, - AddressComponent, - LatestBlocksComponent, - SearchFormComponent, - TimeSpanComponent, - AddressLabelsComponent, - FooterComponent, - MempoolBlockComponent, - FeeDistributionGraphComponent, - IncomingTransactionsGraphComponent, - MempoolGraphComponent, - PoolRankingComponent, - PoolComponent, - LbtcPegsGraphComponent, - AssetComponent, - AssetsComponent, - StatusViewComponent, - FeesBoxComponent, - DashboardComponent, - DifficultyComponent, - TermsOfServiceComponent, - PrivacyPolicyComponent, - TrademarkPolicyComponent, - SponsorComponent, - PushTransactionComponent, - AssetsNavComponent, - AssetsFeaturedComponent, - AssetGroupComponent, - AssetCirculationComponent, - MiningDashboardComponent, - HashrateChartComponent, - HashrateChartPoolsComponent, - MiningStartComponent, - AmountShortenerPipe, - GraphsComponent, - DifficultyAdjustmentsTable, - BlocksList, - DataCyDirective, - RewardStatsComponent, - BlockFeesGraphComponent, - BlockRewardsGraphComponent, - BlockFeeRatesGraphComponent, - LoadingIndicatorComponent, - IndexingProgressComponent, - BlockSizesWeightsGraphComponent ], imports: [ BrowserModule.withServerTransition({ appId: 'serverApp' }), @@ -144,14 +26,7 @@ import { BlockSizesWeightsGraphComponent } from './components/block-sizes-weight AppRoutingModule, HttpClientModule, BrowserAnimationsModule, - InfiniteScrollModule, - NgbTypeaheadModule, - NgbModule, - FontAwesomeModule, SharedModule, - NgxEchartsModule.forRoot({ - echarts: () => import('echarts') - }) ], providers: [ ElectrsApiService, @@ -167,41 +42,4 @@ import { BlockSizesWeightsGraphComponent } from './components/block-sizes-weight ], bootstrap: [AppComponent] }) -export class AppModule { - constructor(library: FaIconLibrary) { - library.addIcons(faInfoCircle); - library.addIcons(faChartArea); - library.addIcons(faTv); - library.addIcons(faTachometerAlt); - library.addIcons(faCubes); - library.addIcons(faHammer); - library.addIcons(faCogs); - library.addIcons(faThList); - library.addIcons(faList); - library.addIcons(faTachometerAlt); - library.addIcons(faDatabase); - library.addIcons(faSearch); - library.addIcons(faLink); - library.addIcons(faBolt); - library.addIcons(faTint); - library.addIcons(faFilter); - library.addIcons(faAngleDown); - library.addIcons(faAngleUp); - library.addIcons(faExchangeAlt); - library.addIcons(faAngleDoubleUp); - library.addIcons(faAngleDoubleDown); - library.addIcons(faChevronDown); - library.addIcons(faFileAlt); - library.addIcons(faRedoAlt); - library.addIcons(faArrowAltCircleRight); - library.addIcons(faExternalLinkAlt); - library.addIcons(faSortUp); - library.addIcons(faCaretUp); - library.addIcons(faCaretDown); - library.addIcons(faAngleRight); - library.addIcons(faAngleLeft); - library.addIcons(faBook); - library.addIcons(faListUl); - library.addIcons(faDownload); - } -} +export class AppModule { } diff --git a/frontend/src/app/bisq/bisq.module.ts b/frontend/src/app/bisq/bisq.module.ts index 77b0a26e8..34c09f971 100644 --- a/frontend/src/app/bisq/bisq.module.ts +++ b/frontend/src/app/bisq/bisq.module.ts @@ -24,6 +24,7 @@ import { BisqAddressComponent } from './bisq-address/bisq-address.component'; import { BisqStatsComponent } from './bisq-stats/bisq-stats.component'; import { BsqAmountComponent } from './bsq-amount/bsq-amount.component'; import { BisqTradesComponent } from './bisq-trades/bisq-trades.component'; +import { CommonModule } from '@angular/common'; @NgModule({ declarations: [ @@ -46,6 +47,7 @@ import { BisqTradesComponent } from './bisq-trades/bisq-trades.component'; BisqMainDashboardComponent, ], imports: [ + CommonModule, BisqRoutingModule, SharedModule, NgbPaginationModule, diff --git a/frontend/src/app/components/address/address.component.html b/frontend/src/app/components/address/address.component.html index fa9e14651..6111075e4 100644 --- a/frontend/src/app/components/address/address.component.html +++ b/frontend/src/app/components/address/address.component.html @@ -66,9 +66,14 @@
24h
, 3d
, 1w
, 1m
, 3m
, 6m
, 1y
, 2y
, 3y
";
const emptyCodeSample = {
esModule: [],
@@ -8,6 +9,9 @@ const emptyCodeSample = {
response: ``
};
+const showJsExamplesDefault = { "": true, "testnet": true, "signet": true, "liquid": true, "liquidtestnet": false, "bisq": true };
+const showJsExamplesDefaultFalse = { "": false, "testnet": false, "signet": false, "liquid": false, "liquidtestnet": false, "bisq": false };
+
export const wsApiDocsData = {
codeTemplate: {
curl: `/api/v1/ws`,
@@ -84,6 +88,7 @@ export const restApiDocsData = [
},
urlString: "/v1/difficulty-adjustment",
showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -168,6 +173,7 @@ export const restApiDocsData = [
},
urlString: "/stats",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -223,6 +229,7 @@ export const restApiDocsData = [
},
urlString: "/currencies",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -273,6 +280,7 @@ export const restApiDocsData = [
},
urlString: "/depth?market=[:market]",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -330,6 +338,7 @@ export const restApiDocsData = [
},
urlString: "/hloc?market=[:market]",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -388,6 +397,7 @@ export const restApiDocsData = [
},
urlString: "/markets",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -444,6 +454,7 @@ export const restApiDocsData = [
},
urlString: "/offers?market=[:market]",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -521,6 +532,7 @@ export const restApiDocsData = [
},
urlString: "/ticker?market=[:market]",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -575,6 +587,7 @@ export const restApiDocsData = [
},
urlString: "/trades?market=[:market]&limit=[:limit]",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -629,6 +642,7 @@ export const restApiDocsData = [
},
urlString: "/volumes?basecurrency=[:basecurrency]",
showConditions: ["bisq"],
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -689,6 +703,7 @@ export const restApiDocsData = [
},
urlString: "/address/:address",
showConditions: bitcoinNetworks.concat(liquidNetworks).concat(["bisq"]),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -847,6 +862,7 @@ export const restApiDocsData = [
},
urlString: "/address/:address/txs",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1000,6 +1016,7 @@ export const restApiDocsData = [
},
urlString: "/address/:address/txs/chain",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1158,6 +1175,7 @@ export const restApiDocsData = [
},
urlString: "/address/:address/txs/mempool",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1284,6 +1302,7 @@ export const restApiDocsData = [
},
urlString: "/address/:address/utxo",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1422,6 +1441,7 @@ export const restApiDocsData = [
},
urlString: "/asset/:asset_id",
showConditions: liquidNetworks,
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1522,6 +1542,7 @@ export const restApiDocsData = [
},
urlString: "/asset/:asset_id/txs[/mempool|/chain]",
showConditions: liquidNetworks,
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1608,6 +1629,7 @@ export const restApiDocsData = [
},
urlString: "/asset/:asset_id/supply[/decimal]",
showConditions: liquidNetworks,
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1658,6 +1680,7 @@ export const restApiDocsData = [
},
urlString: "/v1/assets/icons",
showConditions: liquidNetworks,
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1698,6 +1721,7 @@ export const restApiDocsData = [
},
urlString: "/v1/asset/:asset_id/icon",
showConditions: liquidNetworks,
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
noWrap: true,
@@ -1734,11 +1758,12 @@ export const restApiDocsData = [
fragment: "get-block",
title: "GET Block",
description: {
- default: "Returns details about a block. Available fields: id
, height
, version
, timestamp
, bits
, nonce
, merkle_root
, tx_count
, size
, weight
, and previousblockhash
.",
+ default: "Returns details about a block.",
liquid: "Returns details about a block. Available fields: id
, height
, version
, timestamp
, bits
, nonce
, merkle_root
, tx_count
, size
, weight
,proof
, and previousblockhash
."
},
urlString: "/block/:hash",
showConditions: bitcoinNetworks.concat(liquidNetworks).concat(["bisq"]),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1764,19 +1789,54 @@ export const restApiDocsData = [
commonJS: ['000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'],
curl: ['000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'],
response: `{
- id: "000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce",
- height: 363366,
- version: 2,
- timestamp: 1435766771,
- tx_count: 494,
- size: 286494,
- weight: 1145976,
- merkle_root: "9d3cb87bf05ebae366b4262ed5f768ce8c62fc385c3886c9cb097647b04b686c",
- previousblockhash: "000000000000000010c545b6fa3ef1f7cf45a2a8760b1ee9f2e89673218207ce",
- mediantime: 1435763435,
- nonce: 2892644888,
- bits: 404111758,
- difficulty: 49402014931
+ "extras": {
+ "reward": 638307429,
+ "coinbaseTx": {
+ "vin": [
+ {
+ "scriptsig": "03ad3e0b2cfabe6d6df8fb5429a5de5fc2bd1bafffbc90d33c77eb73307d51931d247f21d7bccde51710000000f09f909f092f4632506f6f6c2f6b0000000000000000000000000000000000000000000000000000000000000000000000050086411100"
+ }
+ ],
+ "vout": [
+ {
+ "scriptpubkey_address": "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY",
+ "value": 638307429
+ }
+ ]
+ },
+ "coinbaseRaw": "03ad3e0b2cfabe6d6df8fb5429a5de5fc2bd1bafffbc90d33c77eb73307d51931d247f21d7bccde51710000000f09f909f092f4632506f6f6c2f6b0000000000000000000000000000000000000000000000000000000000000000000000050086411100",
+ "medianFee": 10,
+ "feeRange": [
+ 1,
+ 8,
+ 9,
+ 10,
+ 15,
+ 21,
+ 348
+ ],
+ "totalFees": 13307429,
+ "avgFee": 5591,
+ "avgFeeRate": 13,
+ "pool": {
+ "id": 36,
+ "name": "F2Pool",
+ "slug": "f2pool"
+ },
+ "matchRate": 93
+ },
+ "id": "00000000000000000007566f8f035a1dc38b351e6f54778b311fe6dbabd79b46",
+ "height": 736941,
+ "version": 536870916,
+ "timestamp": 1652891466,
+ "bits": 386466234,
+ "nonce": 3514220842,
+ "difficulty": 31251101365711.12,
+ "merkle_root": "4a3072f98f60cbb639bb7f46180b8843d17c7502627ffb633db0ed86610cdd71",
+ "tx_count": 2381,
+ "size": 1709571,
+ "weight": 3997770,
+ "previousblockhash": "00000000000000000005ef14db0b4befcbbe1e9b8676eec67fcf810a899c4d5e"
}`
},
codeSampleTestnet: {
@@ -1884,6 +1944,7 @@ export const restApiDocsData = [
},
urlString: "/block/:hash/header",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -1949,6 +2010,7 @@ export const restApiDocsData = [
},
urlString: "/block-height/:height",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2011,6 +2073,7 @@ export const restApiDocsData = [
},
urlString: "/block/:hash/raw",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2076,6 +2139,7 @@ export const restApiDocsData = [
},
urlString: "/block/:hash/status",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2161,6 +2225,7 @@ export const restApiDocsData = [
},
urlString: "/blocks/tip/height",
showConditions: bitcoinNetworks.concat(liquidNetworks).concat(["bisq"]),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2229,6 +2294,7 @@ export const restApiDocsData = [
},
urlString: "/blocks/tip/hash",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2292,6 +2358,7 @@ export const restApiDocsData = [
},
urlString: "/block/:hash/txid/:index",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2357,6 +2424,7 @@ export const restApiDocsData = [
},
urlString: "/block/:hash/txids",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2451,6 +2519,7 @@ export const restApiDocsData = [
},
urlString: "/block/:hash/txs[/:start_index]",
showConditions: bitcoinNetworks.concat(liquidNetworks),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
default: {
codeTemplate: {
@@ -2602,10 +2671,11 @@ export const restApiDocsData = [
fragment: "get-blocks",
title: "GET Blocks",
description: {
- default: "Returns the 10 newest blocks starting at the tip or at :start_height
if specified."
+ default: "Returns details on the past 10 blocks. If :startHeight
is specified, the past 10 blocks before (and including) :startHeight
are returned."
},
- urlString: "/blocks[/:start_height]",
+ urlString: "/blocks[/:startHeight]",
showConditions: bitcoinNetworks.concat(liquidNetworks).concat(["bisq"]),
+ showJsExamples: showJsExamplesDefault,
codeExample: {
bisq: {
codeTemplate: {
@@ -2649,14 +2719,14 @@ export const restApiDocsData = [
commonJS: `
const { %{0}: { blocks } } = mempoolJS();
- const getBlocks = await blocks.getBlocks({ start_height: %{1} });
+ const getBlocks = await blocks.getBlocks({ startHeight: %{1} });
document.getElementById("result").textContent = JSON.stringify(getBlocks, undefined, 2);
`,
esModule: `
const { %{0}: { blocks } } = mempoolJS();
- const getBlocks = await blocks.getBlocks({ start_height: %{1} });
+ const getBlocks = await blocks.getBlocks({ startHeight: %{1} });
console.log(getBlocks);
`,
},
@@ -2773,6 +2843,1443 @@ export const restApiDocsData = [
}
}
},
+ {
+ type: "endpoint",
+ category: "blocks",
+ httpRequestMethod: "GET",
+ fragment: "get-blocks-extras",
+ title: "GET Blocks Extras",
+ description: {
+ default: "Returns details on the past 15 blocks with fee and mining details in an extras
field. If :startHeight
is specified, the past 15 blocks before (and including) :startHeight
are returned."
+ },
+ urlString: "/blocks-extras[/:startHeight]",
+ showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefaultFalse,
+ codeExample: {
+ default: {
+ codeTemplate: {
+ curl: `/api/blocks-extras/%{1}`,
+ commonJS: ``,
+ esModule: ``
+ },
+ codeSampleMainnet: {
+ esModule: [],
+ commonJS: [],
+ curl: ['736915'],
+ response: `[
+ {
+ "extras": {
+ "reward": 629766074,
+ "coinbaseTx": {
+ "vin": [
+ {
+ "scriptsig": "03933e0b215c204d41524120506f6f6c205c00000000be82a250e5ef942790d2542ca87d0000"
+ }
+ ],
+ "vout": [
+ {
+ "scriptpubkey_address": "1A32KFEX7JNPmU1PVjrtiXRrTQcesT3Nf1",
+ "value": 629766074
+ }
+ ]
+ },
+ "coinbaseRaw": "03933e0b215c204d41524120506f6f6c205c00000000be82a250e5ef942790d2542ca87d0000",
+ "medianFee": 14,
+ "feeRange": [
+ 1,
+ 1,
+ 4,
+ 14,
+ 15,
+ 20,
+ 364
+ ],
+ "totalFees": 4766074,
+ "avgFee": 5043,
+ "avgFeeRate": 14,
+ "pool": {
+ "id": 115,
+ "name": "MARA Pool",
+ "slug": "marapool"
+ },
+ "matchRate": 100
+ },
+ "id": "00000000000000000000a742ae476dbe2a58c48b193484945c52b05967f2d74c",
+ "height": 736915,
+ "version": 541065216,
+ "timestamp": 1652877171,
+ "bits": 386466234,
+ "nonce": 4069175824,
+ "difficulty": 31251101365711.12,
+ "merkle_root": "de54fd1adee9f010534e8efbf1244a01528e20dd283c8927026f5442c3e03459",
+ "tx_count": 946,
+ "size": 524907,
+ "weight": 1362339,
+ "previousblockhash": "000000000000000000070760a253405ca69498464d9f8e9fab2452cbbfc10cbe"
+ },
+ {
+ "extras": {
+ "reward": 638804415,
+ "coinbaseTx": {
+ "vin": [
+ {
+ "scriptsig": "03923e0bfabe6d6dc3e96cee3cb68ee52bd31fde8e1f4983a780ea836115788d81a559e03791071f01000000000000001065040008d708c7010000000000007a6d4683012f736c7573682f"
+ }
+ ],
+ "vout": [
+ {
+ "scriptpubkey_address": "1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE",
+ "value": 638804415
+ }
+ ]
+ },
+ "coinbaseRaw": "03923e0bfabe6d6dc3e96cee3cb68ee52bd31fde8e1f4983a780ea836115788d81a559e03791071f01000000000000001065040008d708c7010000000000007a6d4683012f736c7573682f",
+ "medianFee": 14,
+ "feeRange": [
+ 1,
+ 1,
+ 2,
+ 14,
+ 15,
+ 20,
+ 347
+ ],
+ "totalFees": 13804415,
+ "avgFee": 5287,
+ "avgFeeRate": 14,
+ "pool": {
+ "id": 43,
+ "name": "SlushPool",
+ "slug": "slushpool"
+ },
+ "matchRate": 100
+ },
+ "id": "000000000000000000070760a253405ca69498464d9f8e9fab2452cbbfc10cbe",
+ "height": 736914,
+ "version": 555696132,
+ "timestamp": 1652876939,
+ "bits": 386466234,
+ "nonce": 3839610443,
+ "difficulty": 31251101365711.12,
+ "merkle_root": "dc6d15f641e7af26dbaf3ee37203155f8053a8755e85f4955d11ea0c54008b16",
+ "tx_count": 2612,
+ "size": 1450209,
+ "weight": 3931749,
+ "previousblockhash": "00000000000000000002b5b2afc1c62e61e53f966b965a9a8ce99112e24066ae"
+ },
+ ...
+]`,
+ },
+ codeSampleTestnet: {
+ esModule: [],
+ commonJS: [],
+ curl: ['2226118'],
+ response: `[]`
+ },
+ codeSampleSignet: {
+ esModule: [],
+ commonJS: [],
+ curl: ['88832'],
+ response: `[]`
+ },
+ codeSampleLiquid: emptyCodeSample,
+ codeSampleLiquidTestnet: emptyCodeSample,
+ codeSampleBisq: emptyCodeSample,
+ }
+ }
+ },
+ {
+ type: "category",
+ category: "mining",
+ fragment: "mining",
+ title: "Mining",
+ showConditions: bitcoinNetworks
+ },
+ {
+ type: "endpoint",
+ category: "mining",
+ httpRequestMethod: "GET",
+ fragment: "get-mining-pools",
+ title: "GET Mining Pools",
+ description: {
+ default: "Returns a list of all known mining pools ordered by blocks found over the specified trailing :timePeriod
.Leave :timePeriod
unspecified to get all available data, or specify one of the following values: " + miningTimeIntervals + "."
+ },
+ urlString: "/v1/mining/pools[/:timePeriod]",
+ showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefaultFalse,
+ codeExample: {
+ default: {
+ codeTemplate: {
+ curl: `/api/v1/mining/pools/%{1}`,
+ commonJS: ``,
+ esModule: ``
+ },
+ codeSampleMainnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`1w`],
+ response: `{
+ "pools": [
+ {
+ "poolId": 111,
+ "name": "Foundry USA",
+ "link": "https://foundrydigital.com/",
+ "blockCount": 194,
+ "rank": 1,
+ "emptyBlocks": 0,
+ "slug": "foundryusa"
+ },
+ {
+ "poolId": 36,
+ "name": "F2Pool",
+ "link": "https://www.f2pool.com/",
+ "blockCount": 154,
+ "rank": 2,
+ "emptyBlocks": 0,
+ "slug": "f2pool"
+ },
+ {
+ "poolId": 44,
+ "name": "AntPool",
+ "link": "https://www.antpool.com/",
+ "blockCount": 138,
+ "rank": 3,
+ "emptyBlocks": 0,
+ "slug": "antpool"
+ },
+ ...
+ "oldestIndexedBlockTimestamp": 1231006505,
+ "blockCount": 1005,
+ "lastEstimatedHashrate": 230086716765559200000
+}`
+ },
+ codeSampleTestnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`3y`],
+ response: `{
+ "pools": [
+ {
+ "poolId": 112,
+ "name": "SBI Crypto",
+ "link": "https://sbicrypto.com",
+ "blockCount": 26243,
+ "rank": 2,
+ "emptyBlocks": 11272,
+ "slug": "sbicrypto"
+ },
+ {
+ "poolId": 8,
+ "name": "Huobi.pool",
+ "link": "https://www.hpt.com/",
+ "blockCount": 12134,
+ "rank": 3,
+ "emptyBlocks": 6096,
+ "slug": "huobipool"
+ },
+ ...
+ ],
+ "oldestIndexedBlockTimestamp": 1296688602,
+ "blockCount": 2226180,
+ "lastEstimatedHashrate": 602244182177430.8
+}`
+ },
+ codeSampleSignet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`3y`],
+ response: `{}`
+ },
+ codeSampleLiquid: emptyCodeSample,
+ codeSampleLiquidTestnet: emptyCodeSample,
+ codeSampleBisq: emptyCodeSample,
+ }
+ }
+ },
+ {
+ type: "endpoint",
+ category: "mining",
+ httpRequestMethod: "GET",
+ fragment: "get-mining-pool",
+ title: "GET Mining Pool",
+ description: {
+ default: "
Returns details about the mining pool specified by :slug
.
Returns average hashrates (and share of total hashrate) of mining pools active in the specified trailing :timePeriod
, in descending order of hashrate.
Leave :timePeriod
unspecified to get all available data, or specify any of the following time periods: " + miningTimeIntervals.substr(52) + ".
:slug
. Hashrate values are weekly averages."
+ },
+ urlString: "/v1/mining/pool/:slug/hashrate",
+ showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefaultFalse,
+ codeExample: {
+ default: {
+ codeTemplate: {
+ curl: `/api/v1/mining/pool/%{1}/hashrate`,
+ commonJS: ``,
+ esModule: ``
+ },
+ codeSampleMainnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`foundryusa`],
+ response: `[
+ {
+ "timestamp": 1647216000,
+ "avgHashrate": 39126788325841880000,
+ "share": 0.195312,
+ "poolName": "Foundry USA"
+ },
+ {
+ "timestamp": 1647302400,
+ "avgHashrate": 42038778612166990000,
+ "share": 0.208941,
+ "poolName": "Foundry USA"
+ },
+ {
+ "timestamp": 1647820800,
+ "avgHashrate": 40677922193000910000,
+ "share": 0.196597,
+ "poolName": "Foundry USA"
+ },
+ {
+ "timestamp": 1647907200,
+ "avgHashrate": 40210989932016525000,
+ "share": 0.194707,
+ "poolName": "Foundry USA"
+ },
+ {
+ "timestamp": 1648425600,
+ "avgHashrate": 39336856807414260000,
+ "share": 0.194605,
+ "poolName": "Foundry USA"
+ },
+ {
+ "timestamp": 1648512000,
+ "avgHashrate": 39391244745360090000,
+ "share": 0.193487,
+ "poolName": "Foundry USA"
+ },
+ ...
+]`
+ },
+ codeSampleTestnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`kncminer`],
+ response: `[
+ {
+ "timestamp": 1400457600,
+ "avgHashrate": 23504290056.20675,
+ "share": 0.21875,
+ "poolName": "KnCMiner"
+ },
+ {
+ "timestamp": 1401062400,
+ "avgHashrate": 22880315827.385838,
+ "share": 0.301661,
+ "poolName": "KnCMiner"
+ },
+ {
+ "timestamp": 1401667200,
+ "avgHashrate": 65314000516.18979,
+ "share": 0.774853,
+ "poolName": "KnCMiner"
+ },
+ ...
+]`
+ },
+ codeSampleSignet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`unknown`],
+ response: `[
+ {
+ "timestamp": 1600041600,
+ "avgHashrate": 21621.70283633912,
+ "share": 1,
+ "poolName": "Unknown"
+ },
+ {
+ "timestamp": 1600646400,
+ "avgHashrate": 23490.65374463165,
+ "share": 1,
+ "poolName": "Unknown"
+ },
+ {
+ "timestamp": 1601251200,
+ "avgHashrate": 22660.62333333333,
+ "share": 1,
+ "poolName": "Unknown"
+ },
+ ...
+]`
+ },
+ codeSampleLiquid: emptyCodeSample,
+ codeSampleLiquidTestnet: emptyCodeSample,
+ codeSampleBisq: emptyCodeSample,
+ }
+ }
+ },
+ {
+ type: "endpoint",
+ category: "mining",
+ httpRequestMethod: "GET",
+ fragment: "get-mining-pool-blocks",
+ title: "GET Mining Pool Blocks",
+ description: {
+ default: "Returns past 10 blocks mined by the specified mining pool (:slug
) before the specified :blockHeight
. If no :blockHeight
is specified, the mining pool's 10 most recent blocks are returned."
+ },
+ urlString: "/v1/mining/pool/:slug/blocks/[:blockHeight]",
+ showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefaultFalse,
+ codeExample: {
+ default: {
+ codeTemplate: {
+ curl: `/api/v1/mining/pool/%{1}/blocks/%{2}`,
+ commonJS: ``,
+ esModule: ``
+ },
+ codeSampleMainnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`luxor`,`730000`],
+ response: `[
+ {
+ "id": "0000000000000000000572c6eb693c51b728593139079c613c8ea0bc6384e362",
+ "timestamp": 1648778242,
+ "height": 729910,
+ "version": 536895488,
+ "bits": 386521239,
+ "nonce": 1708647181,
+ "difficulty": 28587155782195.14,
+ "merkle_root": "729be37fb4b1bff0ca2e4b572e5dc3fb57e5aa57a8a400f8c89d4993d05c204f",
+ "tx_count": 1808,
+ "size": 1595444,
+ "weight": 3992846,
+ "previousblockhash": "00000000000000000000034e117bb9922da36adc6393fabfe9ed97c7bb38998c",
+ "extras": {
+ "coinbaseRaw": "0336230b315c20506f7765726564206279204c75786f722054656368205c000000002103a960b06341e200000e744596150000000000",
+ "medianFee": 1,
+ "reward": 628988802,
+ "totalFees": 3988802,
+ "pool": {
+ "id": 4
+ }
+ }
+ },
+ {
+ "id": "00000000000000000009b6d122d9e2299d2f9cda13274a9f024bebe52ef96a59",
+ "timestamp": 1648717740,
+ "height": 729820,
+ "version": 536870912,
+ "bits": 386521239,
+ "nonce": 1608169168,
+ "difficulty": 28587155782195.14,
+ "merkle_root": "4f67e65e8e5e554cd4a8d0f91aa63b5e8686817984eb8188af5fb39958263f5d",
+ "tx_count": 1425,
+ "size": 729585,
+ "weight": 1954155,
+ "previousblockhash": "000000000000000000006441657fa1eea37d68784ebd86dc1cd7f89251130f56",
+ "extras": {
+ "coinbaseRaw": "03dc220b315c20506f7765726564206279204c75786f722054656368205c00000000e5ae4908ac1f20df00000410c830000000000000",
+ "medianFee": 8,
+ "reward": 630138805,
+ "totalFees": 5138805,
+ "pool": {
+ "id": 4
+ }
+ }
+ },
+ {
+ "id": "0000000000000000000796834c03bd3be474bfa895146a58015f5ff325ef50c0",
+ "timestamp": 1648653948,
+ "height": 729714,
+ "version": 549453824,
+ "bits": 386547904,
+ "nonce": 883606929,
+ "difficulty": 27452707696466.39,
+ "merkle_root": "45593907e5fa0dee743d2f9194b0923a800cb6313e66221a86bf51df388e012c",
+ "tx_count": 1709,
+ "size": 1434271,
+ "weight": 3993013,
+ "previousblockhash": "000000000000000000000fbfac1a91cdeaf64d689f7673d02613da9d10bfb284",
+ "extras": {
+ "coinbaseRaw": "0372220b315c20506f7765726564206279204c75786f722054656368205c0000000063349a9b3d185fed000007e7092a000000000000",
+ "medianFee": 3,
+ "reward": 632350743,
+ "totalFees": 7350743,
+ "pool": {
+ "id": 4
+ }
+ }
+ },
+ ...
+]`
+ },
+ codeSampleTestnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`bitcoincom`,`2226000`],
+ response: `[
+ {
+ "id": "00000000000000ed428cdb70dfdeb0f3927912131cb96e7b1fe274b1bb1181b2",
+ "timestamp": 1582018014,
+ "height": 1666150,
+ "version": 541065216,
+ "bits": 436312585,
+ "nonce": 21973352,
+ "difficulty": 10474471.99230249,
+ "merkle_root": "541456efe41e5730a563475e0c5e2007ee660f1d86d9778bfc164d73c59fd605",
+ "tx_count": 382,
+ "size": 126201,
+ "weight": 331851,
+ "previousblockhash": "00000000005a0843cc88b09cf6def15e4dc8fe38ab5cf3ad890f34a2df497004",
+ "extras": {
+ "coinbaseRaw": "03666c19706f6f6c2e626974636f696e2e636f6d010000022583010000000000",
+ "medianFee": 1,
+ "reward": 39726335,
+ "totalFees": 663835,
+ "pool": {
+ "id": 12
+ }
+ }
+ },
+ {
+ "id": "00000000000000af90f51e48cb29fdecc62e9961c5e27aca1a4ae8213aae1954",
+ "timestamp": 1579793108,
+ "height": 1663620,
+ "version": 541065216,
+ "bits": 436295134,
+ "nonce": 1762790676,
+ "difficulty": 12563071.03178775,
+ "merkle_root": "02d02afea666f08bab5851de541d0570c71a6cd8be358c28952c52d57b7afad4",
+ "tx_count": 24,
+ "size": 9562,
+ "weight": 23848,
+ "previousblockhash": "000000000000013bbdbc0fef53a5b4b2af02880a6f56f7945de071b71d51123a",
+ "extras": {
+ "coinbaseRaw": "03846219706f6f6c2e626974636f696e2e636f6d01000065f224020000000000",
+ "medianFee": 1,
+ "reward": 39547121,
+ "totalFees": 484621,
+ "pool": {
+ "id": 12
+ }
+ }
+ },
+ ...
+]`
+ },
+ codeSampleSignet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`unknown`,`45000`],
+ response: `[
+ {
+ "id": "00000002440c34e403b2b4e10f390ab105c825dd6285cd6f4050db23cf7e3e46",
+ "timestamp": 1625317548,
+ "height": 44999,
+ "version": 536870912,
+ "bits": 503405326,
+ "nonce": 14354169,
+ "difficulty": 0.002881346304279315,
+ "merkle_root": "3324dc134dec1b57cfea574ce2db6e40e51469417b6381a1389e7969386ab42e",
+ "tx_count": 14,
+ "size": 2971,
+ "weight": 8149,
+ "previousblockhash": "000000d7998f5cf0fb144a400566221574f5f35ebd5d7d9fa803460b6942e237",
+ "extras": {
+ "coinbaseRaw": "03c7af00",
+ "medianFee": 1,
+ "reward": 5000002252,
+ "totalFees": 2252,
+ "pool": {
+ "id": 137
+ }
+ }
+ },
+ {
+ "id": "000000d7998f5cf0fb144a400566221574f5f35ebd5d7d9fa803460b6942e237",
+ "timestamp": 1625317223,
+ "height": 44998,
+ "version": 536870912,
+ "bits": 503405326,
+ "nonce": 4729165,
+ "difficulty": 0.002881346304279315,
+ "merkle_root": "55869f5a52d7709fb2c6df91d64841f4551d659948b7537b6cd8f19c68d27115",
+ "tx_count": 32,
+ "size": 6967,
+ "weight": 18247,
+ "previousblockhash": "000000d6de5b925642a7afed41994947db8612955fbdfd9d1b48f99fc0187385",
+ "extras": {
+ "coinbaseRaw": "03c6af00",
+ "medianFee": 1,
+ "reward": 5000005528,
+ "totalFees": 5528,
+ "pool": {
+ "id": 137
+ }
+ }
+ },
+ ...
+]`
+ },
+ codeSampleLiquid: emptyCodeSample,
+ codeSampleLiquidTestnet: emptyCodeSample,
+ codeSampleBisq: emptyCodeSample,
+ }
+ }
+ },
+ {
+ type: "endpoint",
+ category: "mining",
+ httpRequestMethod: "GET",
+ fragment: "get-hashrate",
+ title: "GET Hashrate",
+ description: {
+ default: "Returns network-wide hashrate and difficulty figures over the specified trailing :timePeriod
:
Valid values for :timePeriod
are " + miningTimeIntervals.substr(52) + ". If no time interval is specified, all available data is returned.
Be sure that INDEXING_BLOCKS_AMOUNT
is set properly in your backend config so that enough blocks are indexed to properly serve your request.
:blockCount
blocks."
+ },
+ urlString: "/v1/mining/reward-stats/:blockCount",
+ showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefaultFalse,
+ codeExample: {
+ default: {
+ codeTemplate: {
+ curl: `/api/v1/mining/reward-stats/%{1}`,
+ commonJS: ``,
+ esModule: ``
+ },
+ codeSampleMainnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`100`],
+ response: `{
+ "startBlock": 736556,
+ "endBlock": 736655,
+ "totalReward": "63811748254",
+ "totalFee": "1311748254",
+ "totalTx": "164216"
+}`
+ },
+ codeSampleTestnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`100`],
+ response: `{
+ "startBlock": 2226086,
+ "endBlock": 2226185,
+ "totalReward": "513462793",
+ "totalFee": "25181593",
+ "totalTx": "2366"
+}`
+ },
+ codeSampleSignet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`100`],
+ response: `{
+ "startBlock": 90899,
+ "endBlock": 90998,
+ "totalReward": "500001245259",
+ "totalFee": "1245259",
+ "totalTx": "1112"
+}`
+ },
+ codeSampleLiquid: emptyCodeSample,
+ codeSampleLiquidTestnet: emptyCodeSample,
+ codeSampleBisq: emptyCodeSample,
+ }
+ }
+ },
+ {
+ type: "endpoint",
+ category: "mining",
+ httpRequestMethod: "GET",
+ fragment: "get-block-fees",
+ title: "GET Block Fees",
+ description: {
+ default: "Returns average total fees for blocks in the specified :timePeriod
, ordered oldest to newest. :timePeriod
can be any of the following: " + miningTimeIntervals + ".
For 24h
and 3d
time periods, every block is included and fee amounts are exact (not averages). For the 1w
time period, fees may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, fees are averages.
Returns average block rewards for blocks in the specified :timePeriod
, ordered oldest to newest. :timePeriod
can be any of the following: " + miningTimeIntervals + ".
For 24h
and 3d
time periods, every block is included and block rewards are exact (not averages). For the 1w
time period, block rewards may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, block rewards are averages.
:timePeriod
, ordered oldest to newest. :timePeriod
can be any of the following: " + miningTimeIntervals + ".For 24h
and 3d
time periods, every block is included and percentiles are exact (not averages). For the 1w
time period, percentiles may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, percentiles are averages."
+ },
+ urlString: "/v1/mining/blocks/fee-rates/:timePeriod",
+ showConditions: bitcoinNetworks,
+ showJsExamples: showJsExamplesDefaultFalse,
+ codeExample: {
+ default: {
+ codeTemplate: {
+ curl: `/api/v1/mining/blocks/fee-rates/%{1}`,
+ commonJS: ``,
+ esModule: ``
+ },
+ codeSampleMainnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`1m`],
+ response: `{
+ "oldestIndexedBlockTimestamp": 1571434851,
+ "blockFeeRates": [
+ {
+ "avg_height": 732152,
+ "timestamp": 1650132959,
+ "avg_fee_0": 1,
+ "avg_fee_10": 2,
+ "avg_fee_25": 2,
+ "avg_fee_50": 3,
+ "avg_fee_75": 4,
+ "avg_fee_90": 8,
+ "avg_fee_100": 393
+ },
+ {
+ "avg_height": 732158,
+ "timestamp": 1650134432,
+ "avg_fee_0": 1,
+ "avg_fee_10": 1,
+ "avg_fee_25": 2,
+ "avg_fee_50": 4,
+ "avg_fee_75": 6,
+ "avg_fee_90": 10,
+ "avg_fee_100": 240
+ },
+ {
+ "avg_height": 732161,
+ "timestamp": 1650135818,
+ "avg_fee_0": 1,
+ "avg_fee_10": 1,
+ "avg_fee_25": 1,
+ "avg_fee_50": 2,
+ "avg_fee_75": 5,
+ "avg_fee_90": 8,
+ "avg_fee_100": 251
+ },
+ ...
+ ]
+}`
+ },
+ codeSampleTestnet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`1m`],
+ response: `{
+ "oldestIndexedBlockTimestamp": 1296688602,
+ "blockFeeRates": [
+ {
+ "avg_height": 2196306,
+ "timestamp": 1650360168,
+ "avg_fee_0": 1,
+ "avg_fee_10": 1,
+ "avg_fee_25": 1,
+ "avg_fee_50": 1,
+ "avg_fee_75": 2,
+ "avg_fee_90": 28,
+ "avg_fee_100": 2644
+ },
+ {
+ "avg_height": 2196308,
+ "timestamp": 1650361209,
+ "avg_fee_0": 1,
+ "avg_fee_10": 1,
+ "avg_fee_25": 1,
+ "avg_fee_50": 4,
+ "avg_fee_75": 12,
+ "avg_fee_90": 65,
+ "avg_fee_100": 102
+ },
+ ...
+ ]
+}`
+ },
+ codeSampleSignet: {
+ esModule: [],
+ commonJS: [],
+ curl: [`1m`],
+ response: `{
+ "oldestIndexedBlockTimestamp": 1598918400,
+ "blockFeeRates": [
+ {
+ "avg_height": 86620,
+ "timestamp": 1650360010,
+ "avg_fee_0": 1,
+ "avg_fee_10": 1,
+ "avg_fee_25": 1,
+ "avg_fee_50": 1,
+ "avg_fee_75": 1,
+ "avg_fee_90": 1,
+ "avg_fee_100": 1
+ },
+ {
+ "avg_height": 86623,
+ "timestamp": 1650361330,
+ "avg_fee_0": 1,
+ "avg_fee_10": 1,
+ "avg_fee_25": 1,
+ "avg_fee_50": 1,
+ "avg_fee_75": 1,
+ "avg_fee_90": 1,
+ "avg_fee_100": 1
+ },
+ ...
+ ]
+}`
+ },
+ codeSampleLiquid: emptyCodeSample,
+ codeSampleLiquidTestnet: emptyCodeSample,
+ codeSampleBisq: emptyCodeSample,
+ }
+ }
+ },
+ {
+ type: "endpoint",
+ category: "mining",
+ httpRequestMethod: "GET",
+ fragment: "get-sizes-weights",
+ title: "GET Block Sizes and Weights",
+ description: {
+ default: "
Returns average size (bytes) and average weight (weight units) for blocks in the specified :timePeriod
, ordered oldest to newest. :timePeriod
can be any of the following: " + miningTimeIntervals + ".
For 24h
and 3d
time periods, every block is included and figures are exact (not averages). For the 1w
time period, figures may be averages depending on how fast blocks were found around a particular timestamp. For other time periods, figures are averages.