@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.mjs
CHANGED
|
@@ -10451,21 +10451,23 @@ var DlmmModule = class {
|
|
|
10451
10451
|
const active_min = get_storage_id_from_real_id(get_real_id_from_price_x1282(min_price.toDecimalPlaces(0).toString(), params.bin_step));
|
|
10452
10452
|
const active_max = get_storage_id_from_real_id(get_real_id_from_price_x1282(max_price.toDecimalPlaces(0).toString(), params.bin_step));
|
|
10453
10453
|
const allCoins = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress);
|
|
10454
|
-
let primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.coinTypeA, false, true);
|
|
10455
|
-
let primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountBTotal), params.coinTypeB, false, true);
|
|
10456
10454
|
let amount_min = 0;
|
|
10457
10455
|
let amount_max = 0;
|
|
10456
|
+
let primaryCoinAInputs;
|
|
10457
|
+
let primaryCoinBInputs;
|
|
10458
10458
|
if (params.fixCoinA && params.fixCoinB) {
|
|
10459
|
-
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.
|
|
10459
|
+
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.coinTypeA, false, true);
|
|
10460
10460
|
primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountBTotal), params.coinTypeB, false, true);
|
|
10461
10461
|
} else if (params.fixCoinA) {
|
|
10462
|
+
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountATotal), params.coinTypeA, false, true);
|
|
10462
10463
|
amount_min = new Decimal10(params.amountBTotal).mul(lower_slippage).toDecimalPlaces(0).toNumber();
|
|
10463
10464
|
amount_max = new Decimal10(params.amountBTotal).mul(upper_slippage).toDecimalPlaces(0).toNumber();
|
|
10464
10465
|
primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(amount_max), params.coinTypeB, false, true);
|
|
10465
10466
|
} else if (params.fixCoinB) {
|
|
10467
|
+
primaryCoinBInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(params.amountBTotal), params.coinTypeB, false, true);
|
|
10466
10468
|
amount_min = new Decimal10(params.amountATotal).mul(lower_slippage).toDecimalPlaces(0).toNumber();
|
|
10467
10469
|
amount_max = new Decimal10(params.amountATotal).mul(upper_slippage).toDecimalPlaces(0).toNumber();
|
|
10468
|
-
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(amount_max), params.
|
|
10470
|
+
primaryCoinAInputs = TransactionUtil.buildCoinForAmount(tx, allCoins, BigInt(amount_max), params.coinTypeA, false, true);
|
|
10469
10471
|
}
|
|
10470
10472
|
if (params.fixCoinA && params.fixCoinB) {
|
|
10471
10473
|
} else if (params.fixCoinA) {
|