@holographxyz/cli
Version:
Holograph operator CLI
20 lines (19 loc) • 751 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const core_chain_service_1 = tslib_1.__importDefault(require("./core-chain-service"));
class TokenChainService extends core_chain_service_1.default {
token;
constructor(network, networkMonitor, contract) {
super(network, networkMonitor);
this.token = contract;
}
balanceOf = async (account) => this.token.balanceOf(account);
allowance = async (account, operator) => this.token.allowance(account, operator);
approve = async (operator, amount) => {
const tx = await this.token.approve(operator, amount);
await tx.wait();
return tx;
};
}
exports.default = TokenChainService;