├── .gitignore ├── data.json ├── .env copy ├── constants └── index.ts ├── utils ├── legacy.ts ├── index.ts ├── spl.ts ├── pump.ts └── swapOnlyAmm.ts ├── package.json ├── config └── index.ts ├── README.md ├── index.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | dist 3 | node_modules 4 | -------------------------------------------------------------------------------- /data.json: -------------------------------------------------------------------------------- 1 | [ 2 | "7LxiSx7mx7T8h97o6dsJkBvWb21PC6sFFpELvoH5HLFQ" 3 | ] -------------------------------------------------------------------------------- /.env copy: -------------------------------------------------------------------------------- 1 | PRIVATE_KEY= 2 | MAXIMUM_BUY_AMOUNT=0.1 3 | SELL_UPPER_PERCENT=0.1 4 | SELL_LOWER_PERCENT=-0.1 5 | UPPER_MC=10000000000 6 | LOWER_MC=0 7 | -------------------------------------------------------------------------------- /constants/index.ts: -------------------------------------------------------------------------------- 1 | export const RPC_ENDPOINT="https://mainnet.helius-rpc.com/?api-key=" 2 | export const RPC_WEBSOCKET_ENDPOINT='wss://atlas-mainnet.helius-rpc.com/?api-key=' 3 | export const MAXIMUM_BUY_AMOUNT=process.env.MAXIMUM_BUY_AMOUNT 4 | export const SELL_UPPER_PERCENT=process.env.SELL_UPPER_PERCENT || 0.1; 5 | export const SELL_LOWER_PERCENT=process.env.SELL_LOWER_PERCENT || -0.1; 6 | export const UPPER_MC=process.env.UPPER_MC || 10000000000; 7 | export const LOWER_MC=process.env.LOWER_MC || 0; -------------------------------------------------------------------------------- /utils/legacy.ts: -------------------------------------------------------------------------------- 1 | import { Connection, VersionedTransaction } from "@solana/web3.js"; 2 | import { RPC_ENDPOINT, RPC_WEBSOCKET_ENDPOINT } from "../constants"; 3 | 4 | 5 | interface Blockhash { 6 | blockhash: string; 7 | lastValidBlockHeight: number; 8 | } 9 | 10 | export const execute = async (transaction: VersionedTransaction) => { 11 | const solanaConnection = new Connection(RPC_ENDPOINT, { 12 | wsEndpoint: RPC_WEBSOCKET_ENDPOINT, 13 | }) 14 | 15 | const signature = await solanaConnection.sendTransaction(transaction); 16 | return signature 17 | } 18 | -------------------------------------------------------------------------------- /utils/index.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | 3 | export function readJson(filename: string = "data.json"): string[] { 4 | if (!fs.existsSync(filename)) { 5 | // If the file does not exist, create an empty array 6 | fs.writeFileSync(filename, '[]', 'utf-8'); 7 | } 8 | const data = fs.readFileSync(filename, 'utf-8'); 9 | return JSON.parse(data) as string[]; 10 | } 11 | 12 | // Function to write JSON file 13 | export function writeJson( data: string[], filename: string = "data.json",): void { 14 | fs.writeFileSync(filename, JSON.stringify(data, null, 4), 'utf-8'); 15 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wallet-tracking-bot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "ts-node index.ts", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "@coral-xyz/anchor": "^0.30.1", 15 | "@metaplex-foundation/js": "^0.20.1", 16 | "@raydium-io/raydium-sdk": "^1.3.1-beta.58", 17 | "@solana/spl-token": "^0.4.8", 18 | "@solana/web3.js": "^1.95.3", 19 | "@types/node-cron": "^3.0.11", 20 | "axios": "^1.7.7", 21 | "bn.js": "^5.2.1", 22 | "bs58": "^6.0.0", 23 | "dotenv": "^16.4.5", 24 | "fs": "^0.0.1-security", 25 | "node-cron": "^3.0.3", 26 | "nodemon": "^3.1.4", 27 | "pm2": "^5.4.2", 28 | "redis": "^4.7.0", 29 | "ts-node": "^10.9.2", 30 | "typescript": "^5.6.2" 31 | }, 32 | "devDependencies": { 33 | "@types/node-telegram-bot-api": "^0.64.7" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /utils/spl.ts: -------------------------------------------------------------------------------- 1 | import { Connection, GetProgramAccountsFilter } from "@solana/web3.js"; 2 | import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; 3 | 4 | /** 5 | * 6 | * @param pubkey 7 | * @returns 8 | */ 9 | export async function getAtaList(connection: Connection, pubkey: string) { 10 | const filters: GetProgramAccountsFilter[] = [ 11 | { 12 | dataSize: 165, //size of account (bytes) 13 | }, 14 | { 15 | memcmp: { 16 | offset: 32, //location of our query in the account (bytes) 17 | bytes: pubkey, //our search criteria, a base58 encoded string 18 | }, 19 | }]; 20 | const accounts = await connection.getParsedProgramAccounts( 21 | TOKEN_PROGRAM_ID, //new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") 22 | { filters: filters } 23 | ); 24 | const ataList = accounts.map((account: any, i: any) => account.pubkey.toBase58()); 25 | 26 | return [pubkey, ...ataList] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /config/index.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import dotenv from "dotenv"; 3 | 4 | dotenv.config(); 5 | 6 | export const heliusPOST = async (uri: string, data: any) => { 7 | const returnData = await axios.post(`https://api.helius.xyz/v0/token-metadata?api-key=80e81ffd-0711-23ha-afac-e64d099b279e`, data) 8 | return returnData.data 9 | } 10 | 11 | export const getTokenPrice = async (tokenAddr : string) => { 12 | const tokenAPrice = await axios.get(`https://api.geckoterminal.com/api/v2/simple/networks/solana/token_price/${tokenAddr}`); 13 | return parseFloat(tokenAPrice?.data?.data?.attributes?.token_prices?.[tokenAddr] ?? '0'); 14 | } 15 | 16 | export const getDomainAcc = async (programAddr : string) => { 17 | const domain = await axios.get(`https://api.solana.fm/v0/accounts/${programAddr}`) 18 | } 19 | 20 | export const getAllTokenPrice = async () => { 21 | const prices = (await axios.get("https://api.raydium.io/v2/main/price")).data 22 | // console.log("update token List") 23 | return prices; 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Pumpfun Copy Trading Bot 2 | 3 | A Pumpfun Copy Trading Bot on Solana automatically tracks and mimics the trades of a specific trader's wallet. It monitors the trader's transactions (such as buying or selling tokens) and automatically executes the same actions in your wallet in real-time. The bot allows you to follow experienced traders without manually managing trades, copying their buys and sells on the Pumpfun platform as well as other supported exchanges. 4 | 5 | ### Bot Features 6 | - Track Token Swaps: Continuously monitors every token swap on the Solana network to identify the best opportunities. 7 | - Trade Across Multiple DEXs: Swap tokens on any supported decentralized exchange according to your preferences, including Pumpfun, Raydium, and Jupiter. 8 | - Automatic Trades: Let the bot automatically buy and sell based on your customized strategy, so you don’t have to lift a finger. 9 | - Customizable Trading Strategy: Tailor your own trading approach to fit your risk tolerance and goals. 10 | - Multi-Wallet Support: Set up and manage multiple wallets, executing trades on each simultaneously. 11 | 12 | ### Enhanced websocket 13 | 14 | ```json 15 | { 16 | "jsonrpc": "2.0", 17 | "id": 420, 18 | "method": "transactionSubscribe", 19 | "params": [ 20 | { 21 | "vote": false, 22 | "failed": false, 23 | "signature": "2dd5zTLrSs2udfNsegFRCnzSyQcPrM9svX6m1UbEM5bSdXXFj3XpqaodtKarLYFP2mTVUsV27sRDdZCgcKhjeD9S", 24 | "accountInclude": ["pqx3fvvh6b2eZBfLhTtQ5KxzU3CginmgGTmDCjk8TPP"], 25 | "accountExclude": ["FbfwE8ZmVdwUbbEXdq4ofhuUEiAxeSk5kaoYrJJekpnZ"], 26 | "accountRequired": ["As1XYY9RdGkjs62isDhLKG3yxMCMatnbanXrqU85XvXW"] 27 | }, 28 | { 29 | "commitment": "processed", 30 | "encoding": "base64", 31 | "transactionDetails": "full", 32 | "showRewards": true, 33 | "maxSupportedTransactionVersion": 0 34 | } 35 | ] 36 | } 37 | ``` 38 | 39 | # 👤 Author 40 | ### Telegram: [@frankiekevin](https://t.me/frankykevin) 41 | -------------------------------------------------------------------------------- /utils/pump.ts: -------------------------------------------------------------------------------- 1 | import * as web3 from "@solana/web3.js"; 2 | import { PublicKey } from "@solana/web3.js"; 3 | import { RPC_ENDPOINT } from "../constants"; 4 | import { NATIVE_MINT } from "@solana/spl-token"; 5 | import { getTokenPrice } from "../config"; 6 | 7 | const TRADE_PROGRAM_ID = new PublicKey( 8 | "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" 9 | ); 10 | const BONDING_ADDR_SEED = new Uint8Array([ 11 | 98, 111, 110, 100, 105, 110, 103, 45, 99, 117, 114, 118, 101, 12 | ]); 13 | 14 | function readBytes(buf: Buffer, offset: number, length: number): Buffer { 15 | const end = offset + length; 16 | if (buf.byteLength < end) throw new RangeError("range out of bounds"); 17 | return buf.subarray(offset, end); 18 | } 19 | 20 | function readBigUintLE(buf: Buffer, offset: number, length: number): bigint { 21 | switch (length) { 22 | case 1: 23 | return BigInt(buf.readUint8(offset)); 24 | case 2: 25 | return BigInt(buf.readUint16LE(offset)); 26 | case 4: 27 | return BigInt(buf.readUint32LE(offset)); 28 | case 8: 29 | return buf.readBigUint64LE(offset); 30 | } 31 | throw new Error(`unsupported data size (${length} bytes)`); 32 | } 33 | 34 | function readBoolean(buf: Buffer, offset: number, length: number): boolean { 35 | const data = readBytes(buf, offset, length); 36 | for (const b of data) { 37 | if (b) return true; 38 | } 39 | return false; 40 | } 41 | 42 | 43 | const PUMP_CURVE_TOKEN_DECIMALS = 6; 44 | 45 | // Calculated as the first 8 bytes of: `sha256("account:BondingCurve")`. 46 | const PUMP_CURVE_STATE_SIGNATURE = Uint8Array.from([ 47 | 0x17, 0xb7, 0xf8, 0x37, 0x60, 0xd8, 0xac, 0x60, 48 | ]); 49 | 50 | const PUMP_CURVE_STATE_SIZE = 0x29; 51 | const PUMP_CURVE_STATE_OFFSETS = { 52 | VIRTUAL_TOKEN_RESERVES: 0x08, 53 | VIRTUAL_SOL_RESERVES: 0x10, 54 | REAL_TOKEN_RESERVES: 0x18, 55 | REAL_SOL_RESERVES: 0x20, 56 | TOKEN_TOTAL_SUPPLY: 0x28, 57 | COMPLETE: 0x30, 58 | }; 59 | 60 | interface PumpCurveState { 61 | virtualTokenReserves: bigint; 62 | virtualSolReserves: bigint; 63 | realTokenReserves: bigint; 64 | realSolReserves: bigint; 65 | tokenTotalSupply: bigint; 66 | complete: boolean; 67 | } 68 | 69 | export async function getPumpCurveState( 70 | curveAddress: string 71 | ): Promise { 72 | // Private code, 73 | } 74 | 75 | export const getPairAddress = (mintAddress: string) => { 76 | // Private code 77 | }; 78 | 79 | // Calculates token price (in SOL) of a Pump.fun bonding curve. 80 | export function calculatePumpCurvePrice(curveState: PumpCurveState): number { 81 | // Private code 82 | } 83 | 84 | export const getPumpCurveData = async (address: string) => { 85 | // Private code 86 | }; 87 | -------------------------------------------------------------------------------- /utils/swapOnlyAmm.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert'; 2 | 3 | import { 4 | PublicKey, 5 | Keypair, 6 | Connection, 7 | VersionedTransaction 8 | } from '@solana/web3.js'; 9 | 10 | export const getBuyTxWithJupiter = async (wallet: Keypair, quoteMint: PublicKey, amount: number) => { 11 | try { 12 | const quoteResponse = await ( 13 | await fetch( 14 | `https://quote-api.jup.ag/v6/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=${quoteMint.toBase58()}&amount=${amount}&slippageBps=1000` 15 | ) 16 | ).json(); 17 | 18 | // console.log("🚀 ~ getBuyTxWithJupiter ~ quoteResponse:", quoteResponse) 19 | // get serialized transactions for the swap 20 | const { swapTransaction } = await ( 21 | await fetch("https://quote-api.jup.ag/v6/swap", { 22 | method: "POST", 23 | headers: { 24 | "Content-Type": "application/json", 25 | }, 26 | body: JSON.stringify({ 27 | quoteResponse, 28 | userPublicKey: wallet.publicKey.toString(), 29 | wrapAndUnwrapSol: true, 30 | dynamicComputeUnitLimit: true, 31 | prioritizationFeeLamports: 52000 32 | }), 33 | }) 34 | ).json(); 35 | 36 | // deserialize the transaction 37 | const swapTransactionBuf = Buffer.from(swapTransaction, "base64"); 38 | var transaction = VersionedTransaction.deserialize(swapTransactionBuf); 39 | 40 | // sign the transaction 41 | transaction.sign([wallet]); 42 | return transaction 43 | } catch (error) { 44 | console.log("Failed to get buy transaction", error) 45 | return null 46 | } 47 | }; 48 | 49 | 50 | export const getSellTxWithJupiter = async (wallet: Keypair, baseMint: PublicKey, amount: number) => { 51 | try { 52 | const quoteResponse = await ( 53 | await fetch( 54 | `https://quote-api.jup.ag/v6/quote?inputMint=${baseMint.toBase58()}&outputMint=So11111111111111111111111111111111111111112&amount=${amount}&slippageBps=1000` 55 | ) 56 | ).json(); 57 | console.log("🚀 ~ getSellTxWithJupiter ~ quoteResponse:", quoteResponse) 58 | 59 | // get serialized transactions for the swap 60 | const { swapTransaction } = await ( 61 | await fetch("https://quote-api.jup.ag/v6/swap", { 62 | method: "POST", 63 | headers: { 64 | "Content-Type": "application/json", 65 | }, 66 | body: JSON.stringify({ 67 | quoteResponse, 68 | userPublicKey: wallet.publicKey.toString(), 69 | wrapAndUnwrapSol: true, 70 | dynamicComputeUnitLimit: true, 71 | prioritizationFeeLamports: 52000 72 | }), 73 | }) 74 | ).json(); 75 | 76 | // deserialize the transaction 77 | const swapTransactionBuf = Buffer.from(swapTransaction, "base64"); 78 | var transaction = VersionedTransaction.deserialize(swapTransactionBuf); 79 | 80 | // sign the transaction 81 | transaction.sign([wallet]); 82 | return transaction 83 | } catch (error) { 84 | console.log("🚀 ~ getSellTxWithJupiter ~ error:", error) 85 | console.log("Failed to get sell transaction") 86 | return null 87 | } 88 | }; -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | import WebSocket from 'ws'; 2 | import { Metaplex } from "@metaplex-foundation/js"; 3 | import { SPL_ACCOUNT_LAYOUT, TokenAccount } from "@raydium-io/raydium-sdk"; 4 | import { PublicKey, Connection, Keypair, TransactionInstruction } from '@solana/web3.js' 5 | import { getMint, TOKEN_PROGRAM_ID, getAccount, NATIVE_MINT, getAssociatedTokenAddress } from '@solana/spl-token'; 6 | 7 | import { getAllTokenPrice, getTokenPrice } from "./config"; 8 | import { getAtaList } from "./utils/spl"; 9 | import { getBuyTxWithJupiter, getSellTxWithJupiter } from "./utils/swapOnlyAmm"; 10 | import base58 from 'bs58' 11 | import axios from 'axios'; 12 | import cron from "node-cron"; 13 | import { RPC_ENDPOINT, RPC_WEBSOCKET_ENDPOINT, MAXIMUM_BUY_AMOUNT, SELL_UPPER_PERCENT, SELL_LOWER_PERCENT, LOWER_MC, UPPER_MC, JITO_KEY } from './constants'; 14 | import { execute } from './utils/legacy'; 15 | import { readJson } from './utils'; 16 | import { getPumpCurveData } from './utils/pump'; 17 | import { createClient } from 'redis'; 18 | 19 | const connection = new Connection(RPC_ENDPOINT) 20 | const ws = new WebSocket(RPC_WEBSOCKET_ENDPOINT); 21 | const keyPair = Keypair.fromSecretKey(base58.decode(process.env.PRIVATE_KEY as string)); 22 | 23 | const metaplex = Metaplex.make(connection); 24 | let geyserList: any = [] 25 | // const wallet = TARGET_WALLET as string; 26 | const wallets = readJson(); 27 | console.log("🚀 ~ wallet:", wallets) 28 | let buyTokenList: string[] = []; 29 | let activeBuyToken: string = ""; 30 | let activeSellToken: string = ""; 31 | 32 | const getMetaData = async (mintAddr: string) => { 33 | let mintAddress = new PublicKey(mintAddr); 34 | 35 | // Private code 36 | } 37 | 38 | let tokenList: any; 39 | tokenList = getAllTokenPrice() 40 | 41 | const connectRedis = () => { 42 | redisClient.on('connect', function () { 43 | console.log('Redis database connected' + '\n'); 44 | 45 | // Function to send a request to the WebSocket server 46 | 47 | ws.on('open', async function open() { 48 | wallets.map(async (wallet: any) => { 49 | await sendRequest(wallet) 50 | }) 51 | console.log("send request\n") 52 | }); 53 | }); 54 | 55 | redisClient.on('reconnecting', function () { 56 | console.log('Redis client reconnecting'); 57 | }); 58 | 59 | redisClient.on('ready', function () { 60 | console.log('Redis client is ready'); 61 | }); 62 | 63 | redisClient.on('error', function (err) { 64 | console.log('Something went wrong ' + err); 65 | }); 66 | 67 | redisClient.on('end', function () { 68 | console.log('\nRedis client disconnected'); 69 | console.log('Server is going down now...'); 70 | process.exit(); 71 | }); 72 | 73 | redisClient.connect(); 74 | } 75 | 76 | connectRedis(); 77 | 78 | 79 | ws.on('message', async function incoming(data: any) { 80 | // Private code 81 | }); 82 | 83 | export async function sendRequest(inputpubkey: string) { 84 | 85 | // Private code 86 | 87 | } 88 | 89 | const EVERY_5_SEC = "*/5 * * * * *"; 90 | try { 91 | cron 92 | .schedule(EVERY_5_SEC, async () => { 93 | try { 94 | const accountInfo = await connection.getAccountInfo(keyPair.publicKey) 95 | 96 | const tokenAccounts = await connection.getTokenAccountsByOwner(keyPair.publicKey, { 97 | programId: TOKEN_PROGRAM_ID, 98 | }, 99 | "confirmed" 100 | ) 101 | // Private code 102 | } catch (error) { 103 | // console.log("🚀 ~ wallets.map ~ error:", error) 104 | return 105 | } 106 | }) 107 | .start(); 108 | } catch (error) { 109 | console.error( 110 | `Error running the Schedule Job for fetching the chat data: ${error}` 111 | ); 112 | } 113 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 40 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 41 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 42 | // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ 43 | "resolveJsonModule": true, /* Enable importing .json files. */ 44 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 45 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 46 | 47 | /* JavaScript Support */ 48 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 49 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 50 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 51 | 52 | /* Emit */ 53 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 54 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 55 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 56 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 57 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 58 | // "noEmit": true, /* Disable emitting files from a compilation. */ 59 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 60 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 61 | // "removeComments": true, /* Disable emitting comments. */ 62 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 63 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 64 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 65 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 66 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 67 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 68 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 69 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 70 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 71 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 72 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 73 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 74 | 75 | /* Interop Constraints */ 76 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 77 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 78 | // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ 79 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 80 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 81 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 82 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 83 | 84 | /* Type Checking */ 85 | "strict": true, /* Enable all strict type-checking options. */ 86 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 87 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 88 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 89 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 90 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 91 | // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ 92 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 93 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 94 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 95 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 96 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 97 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 98 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 99 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 100 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 101 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 102 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 103 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 104 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 105 | 106 | /* Completeness */ 107 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 108 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 109 | } 110 | } 111 | --------------------------------------------------------------------------------