UNPKG

@bluefin-exchange/bluefin7k-aggregator-sdk

Version:
25 lines (24 loc) 977 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BluemoveContract = void 0; const base_1 = require("../base"); const sui_1 = require("../../../utils/sui"); class BluemoveContract extends base_1.BaseContract { async swap(tx) { const config = this.config.bluemove; const [coinOut] = tx.moveCall({ target: `${config.package}::router::swap_exact_input_`, typeArguments: [this.swapInfo.assetIn, this.swapInfo.assetOut], arguments: [ sui_1.SuiUtils.getCoinValue(this.swapInfo.swapXtoY ? this.swapInfo.coinX.type : this.swapInfo.coinY.type, this.inputCoinObject, tx), // input amount this.inputCoinObject, // input coin tx.pure.u64(0), // min output amount tx.object(config.dexInfo), ], }); return coinOut; } } exports.BluemoveContract = BluemoveContract;