@mercurial-finance/farming-sdk
Advanced tools
Comparing version 1.0.16-abc1234.0 to 1.0.16-abc1234.1
@@ -58,3 +58,2 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty; | ||
var _nodefetch = require('node-fetch'); var _nodefetch2 = _interopRequireDefault(_nodefetch); | ||
@@ -1527,24 +1526,2 @@ | ||
} | ||
// async getClaimableReward(owner: PublicKey) { | ||
// if (!this.eventParser) throw "EventParser not found"; | ||
// const claimMethodBuilder = await this.claimMethodBuilder(owner); | ||
// const claimTransaction = await claimMethodBuilder.transaction(); | ||
// if (!claimTransaction) return; | ||
// const blockhash = ( | ||
// await this.program.provider.connection.getLatestBlockhash("finalized") | ||
// ).blockhash; | ||
// const claimTx = new Transaction({ | ||
// recentBlockhash: blockhash, | ||
// feePayer: SIMULATION_USER, | ||
// }); | ||
// claimTransaction && claimTx.add(claimTransaction); | ||
// const tx = await this.program.provider.connection.simulateTransaction( | ||
// claimTx | ||
// ); | ||
// const simulatedReward = (await parseLogs( | ||
// this.eventParser, | ||
// tx?.value?.logs ?? [] | ||
// )) as { amountA: BN; amountB: BN }; | ||
// return simulatedReward; | ||
// } | ||
static getClaimableRewards(owner, farmMints, connection) { | ||
@@ -1589,4 +1566,6 @@ return __async(this, null, function* () { | ||
const { a, b } = rewardPerToken(poolState, lastTimeRewardApplicable); | ||
const rewardA = userState ? userState.balanceStaked.mul(a.sub(userState.rewardAPerTokenComplete)).div(new (0, _anchor.BN)(1e9)).add(userState.rewardAPerTokenPending) : new (0, _anchor.BN)(0); | ||
const rewardB = userState ? userState.balanceStaked.mul(b.sub(userState.rewardBPerTokenComplete)).div(new (0, _anchor.BN)(1e9)).add(userState.rewardBPerTokenPending) : new (0, _anchor.BN)(0); | ||
if (!userState || !poolState) | ||
return accValue; | ||
const rewardA = userState.balanceStaked.mul(a.sub(userState.rewardAPerTokenComplete)).div(new (0, _anchor.BN)(1e9)).add(userState.rewardAPerTokenPending); | ||
const rewardB = userState.balanceStaked.mul(b.sub(userState.rewardBPerTokenComplete)).div(new (0, _anchor.BN)(1e9)).add(userState.rewardBPerTokenPending); | ||
accValue.set(farmMint, { | ||
@@ -1593,0 +1572,0 @@ rewardA, |
{ | ||
"name": "@mercurial-finance/farming-sdk", | ||
"version": "1.0.16-abc1234.0", | ||
"version": "1.0.16-abc1234.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
347256
4287