clanker-sdk 3.1.1 → 3.1.2
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 +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -73,7 +73,9 @@ var Clanker = class {
|
|
|
73
73
|
const TOTAL_SUPPLY = BigInt("100000000000000000000000000000");
|
|
74
74
|
const priceInPairedToken = initialMarketCapInPairedToken * BigInt(10) ** BigInt(decimals) / TOTAL_SUPPLY;
|
|
75
75
|
const sqrtPrice = Math.sqrt(Number(priceInPairedToken.toString()));
|
|
76
|
-
const
|
|
76
|
+
const rawTick = Math.floor(Math.log(sqrtPrice) / Math.log(Math.sqrt(1.0001)));
|
|
77
|
+
const TICK_SPACING = 200;
|
|
78
|
+
const tick = Math.round(rawTick / TICK_SPACING) * TICK_SPACING;
|
|
77
79
|
return tick;
|
|
78
80
|
} catch (error) {
|
|
79
81
|
throw new Error(`Failed to calculate tick: ${error instanceof Error ? error.message : String(error)}`);
|
package/dist/index.mjs
CHANGED
|
@@ -56,7 +56,9 @@ var Clanker = class {
|
|
|
56
56
|
const TOTAL_SUPPLY = BigInt("100000000000000000000000000000");
|
|
57
57
|
const priceInPairedToken = initialMarketCapInPairedToken * BigInt(10) ** BigInt(decimals) / TOTAL_SUPPLY;
|
|
58
58
|
const sqrtPrice = Math.sqrt(Number(priceInPairedToken.toString()));
|
|
59
|
-
const
|
|
59
|
+
const rawTick = Math.floor(Math.log(sqrtPrice) / Math.log(Math.sqrt(1.0001)));
|
|
60
|
+
const TICK_SPACING = 200;
|
|
61
|
+
const tick = Math.round(rawTick / TICK_SPACING) * TICK_SPACING;
|
|
60
62
|
return tick;
|
|
61
63
|
} catch (error) {
|
|
62
64
|
throw new Error(`Failed to calculate tick: ${error instanceof Error ? error.message : String(error)}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clanker-sdk",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "SDK for deploying tokens using Clanker v3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
|
+
"description": "SDK for deploying tokens using Clanker v3.1.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|