@magmaprotocol/magma-clmm-sdk 0.5.80 → 0.5.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10664,21 +10664,23 @@ var DlmmModule = class {
|
|
|
10664
10664
|
const active_min = (0, import_calc_dlmm3.get_storage_id_from_real_id)((0, import_calc_dlmm3.get_real_id_from_price_x128)(min_price.toDecimalPlaces(0).toString(), params.bin_step));
|
|
10665
10665
|
const active_max = (0, import_calc_dlmm3.get_storage_id_from_real_id)((0, import_calc_dlmm3.get_real_id_from_price_x128)(max_price.toDecimalPlaces(0).toString(), params.bin_step));
|
|
10666
10666
|
const allCoins = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
|
|
10667
|
-
let primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.coinTypeA, false, true);
|
|
10668
|
-
let primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountBTotal), params.coinTypeB, false, true);
|
|
10669
10667
|
let amount_min = 0;
|
|
10670
10668
|
let amount_max = 0;
|
|
10669
|
+
let primaryCoinAInputs;
|
|
10670
|
+
let primaryCoinBInputs;
|
|
10671
10671
|
if (params.fixCoinA && params.fixCoinB) {
|
|
10672
|
-
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.
|
|
10672
|
+
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.coinTypeA, false, true);
|
|
10673
10673
|
primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountBTotal), params.coinTypeB, false, true);
|
|
10674
10674
|
} else if (params.fixCoinA) {
|
|
10675
|
+
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.coinTypeA, false, true);
|
|
10675
10676
|
amount_min = new import_decimal13.default(params.amountBTotal).mul(lower_slippage).toDecimalPlaces(0).toNumber();
|
|
10676
10677
|
amount_max = new import_decimal13.default(params.amountBTotal).mul(upper_slippage).toDecimalPlaces(0).toNumber();
|
|
10677
10678
|
primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(amount_max), params.coinTypeB, false, true);
|
|
10678
10679
|
} else if (params.fixCoinB) {
|
|
10680
|
+
primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountBTotal), params.coinTypeB, false, true);
|
|
10679
10681
|
amount_min = new import_decimal13.default(params.amountATotal).mul(lower_slippage).toDecimalPlaces(0).toNumber();
|
|
10680
10682
|
amount_max = new import_decimal13.default(params.amountATotal).mul(upper_slippage).toDecimalPlaces(0).toNumber();
|
|
10681
|
-
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(amount_max), params.
|
|
10683
|
+
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(amount_max), params.coinTypeA, false, true);
|
|
10682
10684
|
}
|
|
10683
10685
|
if (params.fixCoinA && params.fixCoinB) {
|
|
10684
10686
|
} else if (params.fixCoinA) {
|