Skip to content

Commit

Permalink
fix: stats urls
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-franchi committed Aug 21, 2024
1 parent f891f59 commit 04cc86f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/stores/blockchainStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useBlockchainStatsStore = defineStore('blockchainStats', () => {
const totalTokenSupply = ref(null)

async function fetchTotalStats() {
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/totalstats?limit=1`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/total?limit=1`)
const lastBlock = data.data[0]
activeOraclesCount.value = lastBlock.activeOracles
oraclesCount.value = lastBlock.activeOracles + lastBlock.inactiveOracles
Expand Down
8 changes: 4 additions & 4 deletions src/stores/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useChartsStore = defineStore('charts', () => {

const typeSlug = txType ? '&tx_type=' + txType : ''

const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/statistics/transactions${intervalSlug + typeSlug}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/transactions${intervalSlug + typeSlug}`)

// remove last interval from the response not to show current interval that is being built
transactionsStatistics.value = customInterval ? data.data.reverse() : data.data.slice(1).reverse()
Expand All @@ -33,7 +33,7 @@ export const useChartsStore = defineStore('charts', () => {
? `?min_start_date=${customInterval.minStart}&max_start_date=${customInterval.maxStart}&limit=1000`
: `?interval_by=${interval}&limit=${parseInt(limit) + 1}`

const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/statistics/blocks${intervalSlug}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/blocks${intervalSlug}`)

// remove last interval from the response not to show current interval that is being built
keyblocksStatistics.value = customInterval ? data.data.reverse() : data.data.slice(1).reverse()
Expand All @@ -46,7 +46,7 @@ export const useChartsStore = defineStore('charts', () => {
? `&min_start_date=${customInterval.minStart}&max_start_date=${customInterval.maxStart}&limit=1000`
: `&interval_by=${interval}&limit=${parseInt(limit) + 1}`

const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/statistics/transactions?tx_type=contract_call${intervalSlug}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/transactions?tx_type=contract_call${intervalSlug}`)

// remove last interval from the response not to show current interval that is being built
contractsStatistics.value = customInterval ? data.data.reverse() : data.data.slice(1).reverse()
Expand All @@ -59,7 +59,7 @@ export const useChartsStore = defineStore('charts', () => {
? `?min_start_date=${customInterval.minStart}&max_start_date=${customInterval.maxStart}&limit=100`
: `?interval_by=${interval}&limit=${limit}`

const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/statistics/names${intervalSlug}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/names${intervalSlug}`)

// remove last interval from the response not to show current interval that is being built
namesStatistics.value = customInterval ? data.data.reverse() : data.data.slice(1).reverse()
Expand Down
2 changes: 1 addition & 1 deletion src/stores/keyblockDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const useKeyblockDetailsStore = defineStore('keyblockDetails', () => {

async function fetchKeyblockDeltaStats(keyblockHeight) {
keyblockDeltaStats.value = null
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/deltastats?scope=gen:${keyblockHeight}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/delta?scope=gen:${keyblockHeight}`)
keyblockDeltaStats.value = data.data[0]
}

Expand Down
2 changes: 1 addition & 1 deletion src/stores/oracles.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useOraclesStore = defineStore('oracles', () => {

async function fetchOraclesCount() {
rawOraclesCount.value = null
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/totalstats?limit=1`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/total?limit=1`)
rawOraclesCount.value = data.data[0]
}

Expand Down
2 changes: 1 addition & 1 deletion src/stores/recentBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const useRecentBlocksStore = defineStore('recentBlocks', () => {
}

async function fetchDeltaStats() {
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/deltastats?limit=20`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/stats/delta?limit=20`)
deltaStats.value = data.data
}

Expand Down

0 comments on commit 04cc86f

Please sign in to comment.