@magmaprotocol/magma-clmm-sdk 0.5.54 → 0.5.55

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 CHANGED
@@ -11150,13 +11150,17 @@ var DlmmModule = class {
11150
11150
  coinTypeA: coins[0],
11151
11151
  coinTypeB: coins[1]
11152
11152
  });
11153
- const positionRewards = await this.getEarnedRewards({
11154
- pool_id: item.pool,
11155
- position_id: item.pos_object_id,
11156
- coin_a: coins[0],
11157
- coin_b: coins[1],
11158
- rewards_token: pool_reward_coins.get(item.pool) || []
11159
- });
11153
+ const rewards_token = pool_reward_coins.get(item.pool) || [];
11154
+ let positionRewards = { position_id: item.pool, reward: [], amount: [] };
11155
+ if (rewards_token.length > 0) {
11156
+ positionRewards = await this.getEarnedRewards({
11157
+ pool_id: item.pool,
11158
+ position_id: item.pos_object_id,
11159
+ coin_a: coins[0],
11160
+ coin_b: coins[1],
11161
+ rewards_token: pool_reward_coins.get(item.pool) || []
11162
+ });
11163
+ }
11160
11164
  const positionFees = await this.getEarnedFees({
11161
11165
  pool_id: item.pool,
11162
11166
  position_id: item.pos_object_id,
@@ -11342,7 +11346,7 @@ var DlmmModule = class {
11342
11346
  amount: []
11343
11347
  };
11344
11348
  if (simulateRes.error != null) {
11345
- throw new Error(`fetchBins error code: ${simulateRes.error ?? "unknown error"}`);
11349
+ throw new Error(`getEarnedRewards error code: ${simulateRes.error ?? "unknown error"}`);
11346
11350
  }
11347
11351
  simulateRes.events?.forEach((item) => {
11348
11352
  if (extractStructTagFromType(item.type).name === `DlmmEventEarnedRewards`) {