@meteora-ag/cp-amm-sdk 1.2.9 → 1.2.10

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
@@ -13236,22 +13236,27 @@ var CpAmm = class {
13236
13236
  */
13237
13237
  fundReward(params) {
13238
13238
  return __async(this, null, function* () {
13239
- const { rewardIndex, carryForward, pool, funder, amount } = params;
13240
- const poolState = yield this.fetchPoolState(pool);
13241
- const rewardInfo = poolState.rewardInfos[rewardIndex];
13242
- const { vault, mint } = rewardInfo;
13243
- const tokenProgram = getTokenProgram(rewardIndex);
13239
+ const {
13240
+ funder,
13241
+ rewardIndex,
13242
+ pool,
13243
+ carryForward,
13244
+ amount,
13245
+ rewardMint,
13246
+ rewardVault,
13247
+ rewardMintProgram
13248
+ } = params;
13244
13249
  const preInstructions = [];
13245
13250
  const { ataPubkey: funderTokenAccount, ix: createFunderTokenAccountIx } = yield getOrCreateATAInstruction(
13246
13251
  this._program.provider.connection,
13247
- mint,
13252
+ rewardMint,
13248
13253
  funder,
13249
13254
  funder,
13250
13255
  true,
13251
- tokenProgram
13256
+ rewardMintProgram
13252
13257
  );
13253
13258
  createFunderTokenAccountIx && preInstructions.push(createFunderTokenAccountIx);
13254
- if (mint.equals(_spltoken.NATIVE_MINT) && !amount.isZero()) {
13259
+ if (rewardMint.equals(_spltoken.NATIVE_MINT) && !amount.isZero()) {
13255
13260
  const wrapSOLIx = wrapSOLInstruction(
13256
13261
  funder,
13257
13262
  funderTokenAccount,
@@ -13261,11 +13266,11 @@ var CpAmm = class {
13261
13266
  }
13262
13267
  return yield this._program.methods.fundReward(rewardIndex, amount, carryForward).accountsPartial({
13263
13268
  pool,
13264
- rewardVault: vault,
13265
- rewardMint: mint,
13269
+ rewardVault,
13270
+ rewardMint,
13266
13271
  funderTokenAccount,
13267
13272
  funder,
13268
- tokenProgram
13273
+ tokenProgram: rewardMintProgram
13269
13274
  }).transaction();
13270
13275
  });
13271
13276
  }