@mercurial-finance/farming-sdk
Advanced tools
Comparing version 1.0.15-abc1234.3 to 1.0.15
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -47,3 +47,2 @@ var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var _web3js = require('@solana/web3.js'); | ||
var _bufferlayout = require('buffer-layout'); var BufferLayout = _interopRequireWildcard(_bufferlayout); | ||
@@ -60,3 +59,2 @@ // src/utils.ts | ||
var _nodefetch = require('node-fetch'); var _nodefetch2 = _interopRequireDefault(_nodefetch); | ||
@@ -1529,24 +1527,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) { | ||
@@ -1568,13 +1544,4 @@ return __async(this, null, function* () { | ||
const [clockAccountInfo, ...restAccounts] = accounts; | ||
const ClockLayout = BufferLayout.struct([ | ||
BufferLayout.blob(8, "slot"), | ||
BufferLayout.blob(8, "epochStartTimestamp"), | ||
BufferLayout.blob(8, "epoch"), | ||
BufferLayout.blob(8, "leaderScheduleEpoch"), | ||
BufferLayout.blob(8, "unixTimestamp") | ||
]); | ||
const clockState = (clockAccountInfo == null ? void 0 : clockAccountInfo.data) ? ClockLayout.decode(clockAccountInfo.data) : void 0; | ||
if (!clockState) | ||
throw new Error("Clock state not found"); | ||
const onChainTime = clockState.unixTimestamp; | ||
const clockData = clockAccountInfo == null ? void 0 : clockAccountInfo.data; | ||
const onChainTime = Number(clockData.readBigInt64LE(8 * 4)); | ||
const poolStatesMap = /* @__PURE__ */ new Map(); | ||
@@ -1627,4 +1594,4 @@ for (let i = 0; i < farmMints.length; i++) { | ||
), | ||
b: pool.rewardAPerTokenStored.add( | ||
timePeriod.mul(pool.rewardARateU128).div(totalStake) | ||
b: pool.rewardBPerTokenStored.add( | ||
timePeriod.mul(pool.rewardBRateU128).div(totalStake) | ||
) | ||
@@ -1631,0 +1598,0 @@ }; |
{ | ||
"name": "@mercurial-finance/farming-sdk", | ||
"version": "1.0.15-abc1234.3", | ||
"version": "1.0.15", | ||
"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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
347364
4283