UNPKG

airgap-coin-lib

Version:

The airgap-coin-lib is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.

47 lines 2.19 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var bignumber_1 = require("../../../dependencies/src/bignumber.js-9.0.0/bignumber"); var TezosRewardCalculation005_1 = require("./TezosRewardCalculation005"); var TezosRewardsCalculation006 = /** @class */ (function (_super) { __extends(TezosRewardsCalculation006, _super); function TezosRewardsCalculation006(protocol) { var _this = _super.call(this, protocol) || this; _this.protocol = protocol; _this.tezosNodeConstants = {}; return _this; } TezosRewardsCalculation006.prototype.specificBakingCalculation = function (e, p) { var rewards = this.tezosNodeConstants.baking_reward_per_endorsement; var multiplier = ''; if (p > 0) { multiplier = rewards[1]; } else { multiplier = rewards[0]; } var bakingReward = new bignumber_1.default(multiplier).multipliedBy(e); return bakingReward; }; TezosRewardsCalculation006.prototype.specificEndorsingCalculation = function (priority, number_of_slots) { var priority_idx = priority > 0 ? 1 : 0; var multiplier = new bignumber_1.default(this.tezosNodeConstants.endorsement_reward[priority_idx]); var reward = new bignumber_1.default(number_of_slots).times(multiplier); return reward; }; return TezosRewardsCalculation006; }(TezosRewardCalculation005_1.TezosRewardsCalculation005)); exports.TezosRewardsCalculation006 = TezosRewardsCalculation006; //# sourceMappingURL=TezosRewardCalculation006.js.map