flipmeme-sdk 1.3.57 → 1.3.58
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 +9 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28164,17 +28164,18 @@ function decodeStr(str) {
|
|
|
28164
28164
|
function getPrice(_mintCount, _nftCount, _steepness, _midPoint, _startPrice, _endPrice) {
|
|
28165
28165
|
try {
|
|
28166
28166
|
const n = new import_decimal.default(_mintCount).minus(_nftCount);
|
|
28167
|
-
const steepness = new import_decimal.default(_steepness);
|
|
28168
|
-
const midPoint = new import_decimal.default(_midPoint);
|
|
28167
|
+
const steepness = new import_decimal.default(_steepness).div(1e18);
|
|
28168
|
+
const midPoint = new import_decimal.default(_midPoint).div(1e18);
|
|
28169
28169
|
const startSubEnd = new import_decimal.default(_endPrice).minus(_startPrice);
|
|
28170
28170
|
const a = new import_decimal.default(1).plus(
|
|
28171
|
-
steepness.mul(-1).mul(n.minus(midPoint)).
|
|
28172
|
-
);
|
|
28171
|
+
Math.exp(Number(steepness.mul(-1).mul(n.minus(midPoint)).toString()))
|
|
28172
|
+
).floor();
|
|
28173
28173
|
const b = new import_decimal.default(1).plus(
|
|
28174
|
-
|
|
28175
|
-
);
|
|
28174
|
+
Math.exp(Number(steepness.mul(midPoint).toString()))
|
|
28175
|
+
).floor();
|
|
28176
28176
|
const startPrice = new import_decimal.default(_startPrice);
|
|
28177
|
-
const price = startPrice.plus(startSubEnd.div(a)).minus(startSubEnd.div(b));
|
|
28177
|
+
const price = startPrice.plus(startSubEnd.div(a)).minus(startSubEnd.div(b).floor()).floor();
|
|
28178
|
+
console.log("price in getPrice function", price);
|
|
28178
28179
|
return price;
|
|
28179
28180
|
} catch (error) {
|
|
28180
28181
|
throw new Error(`Price calculation failed: ${error}`);
|
|
@@ -28456,6 +28457,7 @@ var EthereumConnector = class {
|
|
|
28456
28457
|
buyingCount = amount.lt(totalSupply) ? amount : totalSupply;
|
|
28457
28458
|
}
|
|
28458
28459
|
for (let i = 0; i < mintingCount.toNumber(); i++) {
|
|
28460
|
+
expectedMintCount = expectedMintCount.add(1).lt(totalSupply) ? expectedMintCount.add(1) : totalSupply;
|
|
28459
28461
|
totalPrice = totalPrice.plus(
|
|
28460
28462
|
getPrice(
|
|
28461
28463
|
expectedMintCount.toString(),
|
|
@@ -28466,7 +28468,6 @@ var EthereumConnector = class {
|
|
|
28466
28468
|
endPriceStr
|
|
28467
28469
|
)
|
|
28468
28470
|
);
|
|
28469
|
-
expectedMintCount = expectedMintCount.add(1).lt(totalSupply) ? expectedMintCount.add(1) : totalSupply;
|
|
28470
28471
|
}
|
|
28471
28472
|
for (let i = 0; i < buyingCount.toNumber(); i++) {
|
|
28472
28473
|
totalPrice = totalPrice.plus(
|