@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.js
CHANGED
|
@@ -6888,6 +6888,7 @@ var RewarderModule = class {
|
|
|
6888
6888
|
const allCoinAsset = await this._sdk.getOwnerCoinAssets(this._sdk.senderAddress, null);
|
|
6889
6889
|
tx = tx || new import_transactions6.Transaction();
|
|
6890
6890
|
const coinIdMaps = {};
|
|
6891
|
+
const coinIdMaps2 = {};
|
|
6891
6892
|
params.forEach((item) => {
|
|
6892
6893
|
const coinTypeA = normalizeCoinType(item.coinTypeA);
|
|
6893
6894
|
const coinTypeB = normalizeCoinType(item.coinTypeB);
|
|
@@ -6935,10 +6936,10 @@ var RewarderModule = class {
|
|
|
6935
6936
|
const primaryCoinInputs = [];
|
|
6936
6937
|
item.rewarder_coin_types.forEach((type) => {
|
|
6937
6938
|
const coinType = normalizeCoinType(type);
|
|
6938
|
-
let coinInput =
|
|
6939
|
+
let coinInput = coinIdMaps2[type];
|
|
6939
6940
|
if (coinInput === void 0) {
|
|
6940
6941
|
coinInput = TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(0), coinType, false, true);
|
|
6941
|
-
|
|
6942
|
+
coinIdMaps2[coinType] = coinInput;
|
|
6942
6943
|
}
|
|
6943
6944
|
primaryCoinInputs.push(coinInput.targetCoin);
|
|
6944
6945
|
});
|
|
@@ -6950,6 +6951,12 @@ var RewarderModule = class {
|
|
|
6950
6951
|
TransactionUtil.buildTransferCoin(this._sdk, tx, value.targetCoin, key, this._sdk.senderAddress);
|
|
6951
6952
|
}
|
|
6952
6953
|
});
|
|
6954
|
+
Object.keys(coinIdMaps2).forEach((key) => {
|
|
6955
|
+
const value = coinIdMaps2[key];
|
|
6956
|
+
if (value.isMintZeroCoin) {
|
|
6957
|
+
TransactionUtil.buildTransferCoin(this._sdk, tx, value.targetCoin, key, this._sdk.senderAddress);
|
|
6958
|
+
}
|
|
6959
|
+
});
|
|
6953
6960
|
return tx;
|
|
6954
6961
|
}
|
|
6955
6962
|
createCollectRewarderPaylod(params, tx, primaryCoinInputs) {
|