UNPKG

@swaptoshi/dex-module

Version:

Klayr decentralized exchange (dex) on-chain module

31 lines 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TreasurifyCommand = void 0; const klayr_framework_1 = require("klayr-framework"); const utils_1 = require("../utils"); const schema_1 = require("../schema"); const pool_1 = require("../stores/pool"); class TreasurifyCommand extends klayr_framework_1.Modules.BaseCommand { constructor() { super(...arguments); this.schema = schema_1.treasurifyCommandSchema; } async verify(_context) { try { (0, utils_1.verifyTreasurifyParam)(_context.params); } catch (error) { return { status: klayr_framework_1.StateMachine.VerifyStatus.FAIL, error: new Error(error.message), }; } return { status: klayr_framework_1.StateMachine.VerifyStatus.OK }; } async execute(_context) { const poolStore = this.stores.get(pool_1.PoolStore); await poolStore.releaseTokenToProtocolTreasury(_context, _context.params); } } exports.TreasurifyCommand = TreasurifyCommand; //# sourceMappingURL=treasurify_command.js.map