{"_id":"@assertdesignuk/solana-rug","_rev":"2-dcb0cefd83f8180c44995d127e63d20d","name":"@assertdesignuk/solana-rug","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@assertdesignuk/solana-rug","version":"0.0.1","keywords":["solana","blockchain","typescript","rugcheck","solana-rugcheck","security","smartcontracts","dApp","cryptocurrency","defi","raydium","pump.fun","solana-development","solana-security","solidity","web3","crypto"],"author":"","license":"MIT","_id":"@assertdesignuk/solana-rug@0.0.1","maintainers":[{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"}],"dist":{"shasum":"878ee12f360677ea376aff53f6cc440b06553d84","tarball":"https://registry.npmjs.org/@assertdesignuk/solana-rug/-/solana-rug-0.0.1.tgz","fileCount":5,"integrity":"sha512-O3kLL0V+zxgQqiBLcUe4+gUktWW+N9gfbhbQd8XjWC7Iq7kes8l6K5sWymfpsupHKHLHbAeJP98UFlEHy5yNWQ==","signatures":[{"sig":"MEQCIA+IrE4yzqICQOBCAiQE7qm31jw+6GBuqMt2nWKmez8MAiBIq++ZiVMdkcE/gzrTG0a1hgaQY+wmZ36iLYT1UugjeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64060},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":"./dist/index.js"}},"scripts":{"lint":"tsc","test":"jest --config jest.config.ts --detectOpenHandles --coverage --maxWorkers=1","build":"tsup src/index.ts --format cjs,esm --dts","release":"pnpm run build && changeset publish"},"_npmUser":{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"},"_npmVersion":"6.14.17","description":"Rug check for solana tokens. Checks if the token is a rug or not.","directories":{},"_nodeVersion":"14.21.2","dependencies":{"web3":"^4.9.0","axios":"^1.7.2","whois":"^2.14.2","dotenv":"^16.4.5","validator":"^13.12.0","helius-sdk":"^1.3.3","whois-json":"^2.0.4","@solana/web3.js":"^1.92.3","@metaplex-foundation/js":"^0.20.1","@raydium-io/raydium-sdk":"1.3.1-beta.54"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.1.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","@swc/core":"^1.5.28","typescript":"^5.4.5","@types/jest":"^29.5.12","@changesets/cli":"^2.27.5"},"_npmOperationalInternal":{"tmp":"tmp/solana-rug_0.0.1_1726073982285_0.9111790286488153","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@assertdesignuk/solana-rug","version":"0.0.2","keywords":["solana","blockchain","typescript","rugcheck","solana-rugcheck","security","smartcontracts","dApp","cryptocurrency","defi","raydium","pump.fun","solana-development","solana-security","solidity","web3","crypto"],"author":"","license":"MIT","_id":"@assertdesignuk/solana-rug@0.0.2","maintainers":[{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"}],"dist":{"shasum":"58e78a77e192dd55646eb2ab68b9c2b5c2302892","tarball":"https://registry.npmjs.org/@assertdesignuk/solana-rug/-/solana-rug-0.0.2.tgz","fileCount":5,"integrity":"sha512-tn0wWSIWgFBiBFp6rZfb2btyeZLOuPmM3UnXJJRHElQaiaqUNX//Q/R6Bdi5ByF2q5J9eyxYlfaCoVWWguU5fw==","signatures":[{"sig":"MEQCIGe+52hdcUe0NV37qTkuhrebGoc3/Zc+pug0HS7L0r8AAiBKNiZMb+yUuNUy2c1BbMgCoQtAvqokEzYaE5nRTicnhw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64659},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":"./dist/index.js"}},"scripts":{"lint":"tsc","test":"jest --config jest.config.ts --detectOpenHandles --coverage --maxWorkers=1","build":"tsup src/index.ts --format cjs,esm --dts","release":"pnpm run build && changeset publish"},"_npmUser":{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"},"_npmVersion":"6.14.17","description":"Rug check for solana tokens. Checks if the token is a rug or not.","directories":{},"_nodeVersion":"14.21.2","dependencies":{"web3":"^4.9.0","axios":"^1.7.2","whois":"^2.14.2","dotenv":"^16.4.5","validator":"^13.12.0","helius-sdk":"^1.3.3","whois-json":"^2.0.4","@solana/web3.js":"^1.92.3","@metaplex-foundation/js":"^0.20.1","@raydium-io/raydium-sdk":"1.3.1-beta.54"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.1.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","@swc/core":"^1.5.28","typescript":"^5.4.5","@types/jest":"^29.5.12","@changesets/cli":"^2.27.5"},"_npmOperationalInternal":{"tmp":"tmp/solana-rug_0.0.2_1726076409941_0.10779986203749248","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@assertdesignuk/solana-rug","version":"0.0.3","description":"Rug check for solana tokens. Checks if the token is a rug or not.","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","scripts":{"build":"tsup src/index.ts --format cjs,esm --dts","test":"jest --config jest.config.ts --detectOpenHandles --coverage --maxWorkers=1","lint":"tsc","release":"pnpm run build && changeset publish"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":"./dist/index.js"}},"author":"","license":"MIT","devDependencies":{"@changesets/cli":"^2.27.5","@swc/core":"^1.5.28","@types/jest":"^29.5.12","jest":"^29.7.0","ts-jest":"^29.1.4","ts-node":"^10.9.2","tsup":"^8.1.0","typescript":"^5.4.5"},"dependencies":{"@metaplex-foundation/js":"^0.20.1","@raydium-io/raydium-sdk":"1.3.1-beta.54","@solana/web3.js":"^1.92.3","axios":"^1.7.2","dotenv":"^16.4.5","helius-sdk":"^1.3.3","validator":"^13.12.0","web3":"^4.9.0","whois":"^2.14.2","whois-json":"^2.0.4"},"keywords":["solana","blockchain","typescript","rugcheck","solana-rugcheck","security","smartcontracts","dApp","cryptocurrency","defi","raydium","pump.fun","solana-development","solana-security","solidity","web3","crypto"],"_id":"@assertdesignuk/solana-rug@0.0.3","_nodeVersion":"14.21.2","_npmVersion":"6.14.17","dist":{"integrity":"sha512-yIU1lr1eZH0jKSEnMqhrFzw7GS3usO/Y5mqC35E3MZNFbrd0MWaUOnzKtBdfx1kyZ07tTZ17nnZ3xEpLukn5lw==","shasum":"fc816960496e2b8314819922df0a9a5ecb7c9b3b","tarball":"https://registry.npmjs.org/@assertdesignuk/solana-rug/-/solana-rug-0.0.3.tgz","fileCount":5,"unpackedSize":64775,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ9AmBNbxepaMaYCjFkNxh+NqgpoSe/qdz74OwV6TfYQIgIlkuJngeiK12/uEKUu2zjAXVXAWYH/lS/tXX2p9hiLI="}]},"_npmUser":{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"},"directories":{},"maintainers":[{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/solana-rug_0.0.3_1726076571646_0.4627650164278847"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-11T16:59:42.152Z","modified":"2024-09-11T17:42:52.034Z","0.0.1":"2024-09-11T16:59:42.477Z","0.0.2":"2024-09-11T17:40:10.111Z","0.0.3":"2024-09-11T17:42:51.842Z"},"license":"MIT","keywords":["solana","blockchain","typescript","rugcheck","solana-rugcheck","security","smartcontracts","dApp","cryptocurrency","defi","raydium","pump.fun","solana-development","solana-security","solidity","web3","crypto"],"description":"Rug check for solana tokens. Checks if the token is a rug or not.","maintainers":[{"name":"assertdesignuk","email":"assertdesignuk@gmail.com"}],"readme":"# Solana Rugchecker\n\n![Static Badge](https://img.shields.io/badge/degen-100%25-pink)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/degenfrends/solana-rugchecker/publish.yml)\n![NPM License](https://img.shields.io/npm/l/%40degenfrends%2Fsolana-rugchecker)\n![NPM Version](https://img.shields.io/npm/v/@degenfrends/solana-rugchecker)\n![NPM Downloads](https://img.shields.io/npm/dw/@degenfrends/solana-rugchecker)\n![GitHub Repo stars](https://img.shields.io/github/stars/degenfrends/solana-rugchecker)\n\n## This project is under development. Results might fail or give false results. Please evaluate your current version yourself, until this notice disappears. But things are getting more stable since v0.0.14! [Join the discord if you are looking for fellow degen developers!](https://discord.gg/HUVAbet2Dp)\n\nSPLRugchecker is a TypeScript class that checks if a Solana token is a potential rug pull. It analyzes the blockchain to check the token's metadata,\ntop holders and liquidity, and provides methods to calculate a rug score and determine if the token is a potential rug pull.\n\n## Installation\n\nJust install it with npm or yarn or whatever.\n\n```bash\nnpm install \"@degenfrends/solana-rugchecker\"\n```\n\n## Configuration\n\nTo create an instance of `SPLRugchecker`, you need to provide a `RugCheckConfig` object with the `solanaRpcEndpoint` and optional `poolFilePath` or\n`poolAddress` property. But if you want to use environment variables for the configuration, that's possible too. You need to download the pool file\nfrom https://api.raydium.io/v2/sdk/liquidity/mainnet.json and set the path of the file in the `poolFilePath` property.\n\n### 1. Configuration without environment variables\n\n```typescript\nconst rugCheckConfig = {\n    solanaRpcEndpoint: 'https://api.devnet.solana.com'\n    poolFilePath: './mainnet.json' //optional\n    poolAddress: '12345pooladdress' //optional, can't be set with environment variable, since it most likely changes on every check\n    heliusApiKey: 'your-api-key' //optional\n};\nconst rugChecker = new SPLRugchecker(rugCheckConfig);\n```\n\n### 2. Configuration with environment variables\n\nIf you want to configure the rug checker with environment variables, you need to define a `SOLANA_RPC_ENDPOINT` variable and pass an empty object `{}`\nin the constructor. BE AWARE THAT YOU NEED AN RPC ENDPOINT THAT ALLOWS THE `getTokenLargestAccounts` CALL! HELIUS.DEV IS WORKING WITH THE FREE TIER\nFOR EXAMPLE!\n\n```bash\nSOLANA_RPC_ENDPOINT=\"https://api.devnet.solana.com\"\n```\n\n```typescript\nconst rugChecker = new SPLRugchecker({});\n```\n\n## Usage\n\n### Checking a token\n\nTo check a token, call the `check` method with the token's address. This method returns a Promise that resolves to a `RugCheckResult` object. With\nthis result you can do your own calculations whether a token is a rug pull or not.\n\n```typescript\nconst result = await rugChecker.check('tokenAddress');\n```\n\n### Calculating the rug score\n\nIf you don't want to implement your own logic to determine the likelyness of a rug pull, you can calculate the rug score with the `rugScore` method.\n\n```typescript\nconst score = rugChecker.rugScore(result);\n```\n\n### Determining if a token is a potential rug pull\n\nTo determine if a `RugCheckResult` indicates a potential rug pull, call the `isRug` method. This is only necessary if you don't want to determine\nyourself, if the token is a rug or not based on the `RugCheckResult` object or the `rugScore`method.\n\n## Full example\n\n```typescript\nconst SPLRugchecker = require('@degenfrends/solana-rugchecker').default;\n\nconst rugCheckConfig = {\n    solanaRpcEndpoint: 'https://api.devnet.solana.com',\n    // If you set this option, you need to provide a downloaded version of this file: https://api.raydium.io/v2/sdk/liquidity/mainnet.json, otherwise the API from geckoterminal.com is used.\n    poolFilePath: './mainnet.json',\n    // If you set this option, you need to provide the pool address for the token yourself. This might be useful when you build a sniper that is listening on raydium pool creation.\n    poolAddress: '97oWtQfbZMdDbn1jdNciDHm2vnPBR8VT3Ns7vSS7i9cm',\n    // If you set this option, the metadata checker will try to get the Website and Social Media via Helius if the Metaplex request doesn't return any urls for Twitter, Telegram or the Website.\n    heliusApiKey: 'your-helius-key'\n};\nconst rugChecker = new SPLRugchecker(rugCheckConfig);\nconst result = await rugChecker.check('tokenAddress');\n// you can access the detailed results of each check. Log the result to see all information that is returned.\nconst score = rugChecker.rugScore(result);\nconst isRug = rugChecker.isRug(result);\n```\n\nYou can use the checkers indivudually like this, in this example I use the website checker, which is not included in the actual rugchecking logic. But\nthe whois information can give you additional insights about a website and its owner:\n\n```typescript\nconst MetadataChecker = require('@degenfrends/solana-rugchecker').MetadataChecker;\nconst WebsiteChecker = require('@degenfrends/solana-rugchecker').WebsiteChecker;\n\n// get the token metadata first\nconst metadataChecker = new MetadataChecker({\n    solanaRpcEndpoint: 'https://api.devnet.solana.com',\n    heliusApiKey: 'your-api-key'\n});\nconst metadataCheckResult = await metadataChecker.check('1234tokenaddress');\n\n// and then get the whois information for further processing\nconst websiteChecker = new WebsiteChecker();\nconst websiteCheckResult = await websiteChecker.check(result.metadata.website);\n```\n\nIf you have any questions or suggestions, [join the discord!](https://discord.gg/HUVAbet2Dp)\n","readmeFilename":"README.md"}