import { providers } from 'ethers'; import BaseService from '../commons/BaseService'; import { GreenBean, GreenBean__factory } from './typechain'; export class GreenBeanService extends BaseService { readonly contractAddress: string; constructor(provider: providers.Provider, address: string) { super(provider, GreenBean__factory); this.contractAddress = address; } public async filterClaimableTokenIds(azukiIds: number[]) { const instance = this.getContractInstance(this.contractAddress); const claimables = await instance.getCanClaims(azukiIds); return azukiIds.filter((_id, index) => claimables[index]); } }