cosmos-explorer/src/stores/useMintStore.ts
2023-04-06 08:17:40 +08:00

27 lines
633 B
TypeScript

import { defineStore } from "pinia";
import { useBlockchain } from "./useBlockchain";
export const useMintStore = defineStore('mintStore', {
state: () => {
return {
inflation: "0",
}
},
getters: {
blockchain() {
return useBlockchain()
}
},
actions: {
initial() {
this.fetchInflation()
},
async fetchInflation() {
this.blockchain.rpc.getMintInflation().then(x => {
this.inflation = x.inflation
}).catch(() => {
this.inflation = "0"
})
}
}
})