import { providers } from 'ethers'; import BaseService from '../commons/BaseService'; import { eEthereumTxType, EthereumTransactionTypeExtended, transactionType, } from '../commons/types'; import { NTokenStakefish } from './typechain/NTokenStakefish'; import { NTokenStakefish__factory } from './typechain/NTokenStakefish__factory'; export class NTokenStakeFish extends BaseService { instance: NTokenStakefish; constructor(provider: providers.Provider, address: string) { super(provider, NTokenStakefish__factory); this.instance = this.getContractInstance(address); } public claimFee( tokenIds: string[], amountsToClaim: string[], to: string, onBehalfOf: string, ): EthereumTransactionTypeExtended { const txCallback: () => Promise = this.generateTxCallback({ rawTxMethod: async () => this.instance.populateTransaction.claimFeePool( tokenIds, amountsToClaim, to, ), from: onBehalfOf, }); return { tx: txCallback, txType: eEthereumTxType.OTHERS, gas: this.generateTxPriceEstimation([], txCallback), }; } public exit( tokenIds: string[], onBehalfOf: string, ): EthereumTransactionTypeExtended { const txCallback: () => Promise = this.generateTxCallback({ rawTxMethod: async () => this.instance.populateTransaction.requestExit(tokenIds), from: onBehalfOf, }); return { tx: txCallback, txType: eEthereumTxType.OTHERS, gas: this.generateTxPriceEstimation([], txCallback), }; } }