Skip to content

Commit

Permalink
feat: migrate transactions count endpoint (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
janmichek authored Apr 26, 2024
1 parent a5ee669 commit c565147
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/stores/accountDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const useAccountStore = defineStore('account', () => {

async function fetchTotalAccountTransactionsCount(accountId) {
totalAccountTransactionsCount.value = null
const txCountUrl = new URL(`${MIDDLEWARE_URL}/v2/txs/count`)
const txCountUrl = new URL(`${MIDDLEWARE_URL}/v3/transactions/count`)
txCountUrl.searchParams.append('id', accountId)
const { data } = await axios.get(txCountUrl.toString())
totalAccountTransactionsCount.value = data
Expand Down
2 changes: 1 addition & 1 deletion src/stores/blockchainStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const useBlockchainStatsStore = defineStore('blockchainStats', () => {
}

async function fetchTotalTransactionsCount() {
const { data } = await axios.get(`${MIDDLEWARE_URL}/v2/txs/count`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/transactions/count`)
transactionsCount.value = data
}

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

async function fetchContractCallsCount() {
contractCallsCount.value = null
const { data } = await axios.get(`${MIDDLEWARE_URL}/v2/txs/count/${contractId.value}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/transactions/count/${contractId.value}`)
contractCallsCount.value = Object.values(data?.contractCallTx ?? {}).reduce((sum, value) => sum + value, 0)
}

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

async function fetchContractsCount() {
contractsCount.value = null
const { data } = await axios.get(`${MIDDLEWARE_URL}/v2/txs/count?type=contract_create`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/transactions/count?type=contract_create`)
contractsCount.value = data
}

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

async function fetchStateChannelTransactionsCount() {
const { data } = await axios.get(`${MIDDLEWARE_URL}/v2/txs/count?id=${stateChannelId.value}`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/transactions/count?id=${stateChannelId.value}`)
stateChannelTransactionsCount.value = data + 1
}

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

async function fetchStateChannelsCount() {
const { data } = await axios.get(`${MIDDLEWARE_URL}/v2/txs/count?tx_type=channel_create`)
const { data } = await axios.get(`${MIDDLEWARE_URL}/v3/transactions/count?tx_type=channel_create`)
this.stateChannelsCount = data
}

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

async function fetchTransactionsCount(txType = null) {
transactionsCount.value = null
const url = txType ? `${MIDDLEWARE_URL}/v2/txs/count?tx_type=${txType}` : `${MIDDLEWARE_URL}/v2/txs/count`
const url = txType ? `${MIDDLEWARE_URL}/v3/transactions/count?tx_type=${txType}` : `${MIDDLEWARE_URL}/v3/transactions/count`
const { data } = await axios.get(url)
transactionsCount.value = data
}
Expand Down

0 comments on commit c565147

Please sign in to comment.