Files
ImmortalClanVue/src/stores/rewardlocker.js
T

25 lines
700 B
JavaScript

import { defineStore } from "pinia";
import RewardLockerJson from "@/assets/contracts/RewardLocker.json";
export const useRewardLockerStore = defineStore("rewardlocker", {
state: () => ({
config: RewardLockerJson,
contract: null,
}),
getters: {},
actions: {
/*
* @param {*} walletAddress
* @param {*} roundNumber
* @param {*} tokenAddress
* @returns Rewards for specific token and specific round
*/
async getRewards(walletAddress, roundNumber, tokenAddress) {
return await this.contract.methods.rewards(walletAddress, roundNumber, tokenAddress).call();
},
async lastCompletedRound() {
return await this.contract.methods.lastCompletedRound().call();
},
},
});