UNPKG

tokamak-staking-lib

Version:
18 lines (17 loc) 623 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toWAD = exports.toRAY = void 0; const bn_js_1 = __importDefault(require("bn.js")); const { toBN } = require("web3-utils"); const CONVERSION_RATE_OF_WAD_RAY = String(10 ** 9); function toRAY(x) { return x.mul(new bn_js_1.default(CONVERSION_RATE_OF_WAD_RAY)); } exports.toRAY = toRAY; function toWAD(x) { return x.div(new bn_js_1.default(CONVERSION_RATE_OF_WAD_RAY)); } exports.toWAD = toWAD;