@magmaprotocol/magma-clmm-sdk 0.5.69 → 0.5.71
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 +9 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6668,6 +6668,7 @@ var RewarderModule = class {
|
|
|
6668
6668
|
const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress, null);
|
|
6669
6669
|
tx = tx || new Transaction6();
|
|
6670
6670
|
const coinIdMaps = {};
|
|
6671
|
+
const coinIdMaps2 = {};
|
|
6671
6672
|
params.forEach((item) => {
|
|
6672
6673
|
const coinTypeA = normalizeCoinType(item.coinTypeA);
|
|
6673
6674
|
const coinTypeB = normalizeCoinType(item.coinTypeB);
|
|
@@ -6715,10 +6716,10 @@ var RewarderModule = class {
|
|
|
6715
6716
|
const primaryCoinInputs = [];
|
|
6716
6717
|
item.rewarder_coin_types.forEach((type) => {
|
|
6717
6718
|
const coinType = normalizeCoinType(type);
|
|
6718
|
-
let coinInput =
|
|
6719
|
+
let coinInput = coinIdMaps2[type];
|
|
6719
6720
|
if (coinInput === void 0) {
|
|
6720
6721
|
coinInput = TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(0), coinType, false, true);
|
|
6721
|
-
|
|
6722
|
+
coinIdMaps2[coinType] = coinInput;
|
|
6722
6723
|
}
|
|
6723
6724
|
primaryCoinInputs.push(coinInput.targetCoin);
|
|
6724
6725
|
});
|
|
@@ -6730,6 +6731,12 @@ var RewarderModule = class {
|
|
|
6730
6731
|
TransactionUtil.buildTransferCoin(this._sdk, tx, value.targetCoin, key, this._sdk.senderAddress);
|
|
6731
6732
|
}
|
|
6732
6733
|
});
|
|
6734
|
+
Object.keys(coinIdMaps2).forEach((key) => {
|
|
6735
|
+
const value = coinIdMaps2[key];
|
|
6736
|
+
if (value.isMintZeroCoin) {
|
|
6737
|
+
TransactionUtil.buildTransferCoin(this._sdk, tx, value.targetCoin, key, this._sdk.senderAddress);
|
|
6738
|
+
}
|
|
6739
|
+
});
|
|
6733
6740
|
return tx;
|
|
6734
6741
|
}
|
|
6735
6742
|
createCollectRewarderPaylod(params, tx, primaryCoinInputs) {
|