UNPKG

@swaptoshi/dex-module

Version:

Klayr decentralized exchange (dex) on-chain module

15 lines 795 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.verifySwapByTransfer = verifySwapByTransfer; const periphery_1 = require("../../stores/library/periphery"); const isSwapByTransfer_1 = require("./isSwapByTransfer"); async function verifySwapByTransfer(context) { const check = await isSwapByTransfer_1.isSwapByTransfer.bind(this)(context, context.transaction); if (check.status && check.payload) { const key = periphery_1.PoolAddress.decodePoolAddress(check.payload.recipientAddress); if (key.token0.compare(check.payload.tokenID) !== 0 && key.token1.compare(check.payload.tokenID) !== 0) { throw new Error('transfering incompatible token to pool address'); } } } //# sourceMappingURL=verifySwapByTransfer.js.map