{"id":24390465,"url":"https://github.com/texora/pumpfun-bundler","last_synced_at":"2025-10-11T16:44:54.986Z","repository":{"id":272792685,"uuid":"862315421","full_name":"texora/pumpfun-bundler","owner":"texora","description":"PumpFun bundler, create/buy token in single bundler for Pumpfun","archived":false,"fork":false,"pushed_at":"2024-09-24T12:00:46.000Z","size":5337,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T23:13:32.605Z","etag":null,"topics":["bundler","pumpfun","token","typescript"],"latest_commit_sha":null,"homepage":"http://pump.fun/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/texora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-24T11:56:16.000Z","updated_at":"2024-09-24T12:14:07.000Z","dependencies_parsed_at":"2025-01-16T17:52:54.216Z","dependency_job_id":null,"html_url":"https://github.com/texora/pumpfun-bundler","commit_stats":null,"previous_names":["texora/pumpfun-bundler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/texora/pumpfun-bundler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/texora%2Fpumpfun-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/texora%2Fpumpfun-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/texora%2Fpumpfun-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/texora%2Fpumpfun-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/texora","download_url":"https://codeload.github.com/texora/pumpfun-bundler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/texora%2Fpumpfun-bundler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265432606,"owners_count":23764127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundler","pumpfun","token","typescript"],"created_at":"2025-01-19T16:17:43.850Z","updated_at":"2025-10-11T16:44:49.933Z","avatar_url":"https://github.com/texora.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pumpfun Bundler README\n\n## Overview\n\nThis is the best, fastest, and most efficient self-bundling script for PumpFun, allowing you to create a token and buy tokens with your own 25 buyers in one single bundle.\n\n## Installation\n\n`\nnpm i pumpdotfun-sdk\n`\n\n## Usage Example\n\nFirst you need to create a `.env` file and set your RPC URL like in the `.env.example`\n\nThen you need to fund an account with atleast 0.004 SOL that is generated when running the command below\nTo launch your token on Pumpfun site, edit the metadata as desired.\n```typescript\n    const metadata = {\n      \"name\": \"B@mbi\",\n      \"symbol\": \"Bam\",\n      \"description\": \"Bambi token\",\n      \"image\": \"./upload/img.jpg\",\n      \"showName\": true,\n      \"createdOn\": \"https://pump.fun\",\n      \"twitter\": \"https://x.com/bambi\",\n      \"telegram\": \"https://t.me/bambi\",\n      \"website\": \"https://bambi\"\n}\n```\n`\nnpx ts-node example/basic/index.ts\n`\nYou can check token launch and bundling in this link:\n  - pumpfun site\n    https://pump.fun/2q4JLenwD1cRhzSLu3uPMQPw4fTEYp7bLtfmBwFLb48v\n  - solscan.io\n    ![alt text](image.png)\n\n### PumpDotFunSDK Class\n\nThe `PumpDotFunSDK` class provides methods to interact with the PumpFun protocol. Below are the method signatures and their descriptions.\n\n\n#### createAndBuy\n\n```typescript\nasync createAndBuy(\n  creator: Keypair,\n  mint: Keypair,\n  createTokenMetadata: CreateTokenMetadata,\n  buyAmountSol: bigint,\n  slippageBasisPoints: bigint = 500n,\n  priorityFees?: PriorityFee,\n  commitment: Commitment = DEFAULT_COMMITMENT,\n  finality: Finality = DEFAULT_FINALITY\n): Promise\u003cTransactionResult\u003e\n```\n\n- Creates a new token and buys it.\n- **Parameters**:\n  - `creator`: The keypair of the token creator.\n  - `mint`: The keypair of the mint account.\n  - `createTokenMetadata`: Metadata for the token.\n  - `buyAmountSol`: Amount of SOL to buy.\n  - `slippageBasisPoints`: Slippage in basis points (default: 500).\n  - `priorityFees`: Priority fees (optional).\n  - `commitment`: Commitment level (default: DEFAULT_COMMITMENT).\n  - `finality`: Finality level (default: DEFAULT_FINALITY).\n- **Returns**: A promise that resolves to a `TransactionResult`.\n\n#### buy\n\n```typescript\nasync buy(\n  buyer: Keypair,\n  mint: PublicKey,\n  buyAmountSol: bigint,\n  slippageBasisPoints: bigint = 500n,\n  priorityFees?: PriorityFee,\n  commitment: Commitment = DEFAULT_COMMITMENT,\n  finality: Finality = DEFAULT_FINALITY\n): Promise\u003cTransactionResult\u003e\n```\n\n- Buys a specified amount of tokens.\n- **Parameters**:\n  - `buyer`: The keypair of the buyer.\n  - `mint`: The public key of the mint account.\n  - `buyAmountSol`: Amount of SOL to buy.\n  - `slippageBasisPoints`: Slippage in basis points (default: 500).\n  - `priorityFees`: Priority fees (optional).\n  - `commitment`: Commitment level (default: DEFAULT_COMMITMENT).\n  - `finality`: Finality level (default: DEFAULT_FINALITY).\n- **Returns**: A promise that resolves to a `TransactionResult`.\n\n#### sell\n\n```typescript\nasync sell(\n  seller: Keypair,\n  mint: PublicKey,\n  sellTokenAmount: bigint,\n  slippageBasisPoints: bigint = 500n,\n  priorityFees?: PriorityFee,\n  commitment: Commitment = DEFAULT_COMMITMENT,\n  finality: Finality = DEFAULT_FINALITY\n): Promise\u003cTransactionResult\u003e\n```\n\n- Sells a specified amount of tokens.\n- **Parameters**:\n  - `seller`: The keypair of the seller.\n  - `mint`: The public key of the mint account.\n  - `sellTokenAmount`: Amount of tokens to sell.\n  - `slippageBasisPoints`: Slippage in basis points (default: 500).\n  - `priorityFees`: Priority fees (optional).\n  - `commitment`: Commitment level (default: DEFAULT_COMMITMENT).\n  - `finality`: Finality level (default: DEFAULT_FINALITY).\n- **Returns**: A promise that resolves to a `TransactionResult`.\n\n#### addEventListener\n\n```typescript\naddEventListener\u003cT extends PumpFunEventType\u003e(\n  eventType: T,\n  callback: (event: PumpFunEventHandlers[T], slot: number, signature: string) =\u003e void\n): number\n```\n\n- Adds an event listener for the specified event type.\n- **Parameters**:\n  - `eventType`: The type of event to listen for.\n  - `callback`: The callback function to execute when the event occurs.\n- **Returns**: An identifier for the event listener.\n\n#### removeEventListener\n\n```typescript\nremoveEventListener(eventId: number): void\n```\n\n- Removes the event listener with the specified identifier.\n- **Parameters**:\n  - `eventId`: The identifier of the event listener to remove.\n\n### Running the Examples\n\n#### Basic Example\n\nTo run the basic example for creating, buying, and selling tokens, use the following command:\n\n```bash\nnpx ts-node example/basic/index.ts\n```\n\n#### Event Subscription Example\n\nThis example demonstrates how to set up event subscriptions using the PumpFun SDK.\n\n#### Script: `example/events/events.ts`\n\n```typescript\nimport dotenv from \"dotenv\";\nimport { Connection, Keypair } from \"@solana/web3.js\";\nimport { PumpFunSDK } from \"pumpdotfun-sdk\";\nimport NodeWallet from \"@coral-xyz/anchor/dist/cjs/nodewallet\";\nimport { AnchorProvider } from \"@coral-xyz/anchor\";\n\ndotenv.config();\n\nconst getProvider = () =\u003e {\n  if (!process.env.HELIUS_RPC_URL) {\n    throw new Error(\"Please set HELIUS_RPC_URL in .env file\");\n  }\n\n  const connection = new Connection(process.env.HELIUS_RPC_URL || \"\");\n  const wallet = new NodeWallet(new Keypair());\n  return new AnchorProvider(connection, wallet, { commitment: \"finalized\" });\n};\n\nconst setupEventListeners = async (sdk) =\u003e {\n  const createEventId = sdk.addEventListener(\"createEvent\", (event, slot, signature) =\u003e {\n    console.log(\"createEvent\", event, slot, signature);\n  });\n  console.log(\"Subscribed to createEvent with ID:\", createEventId);\n\n  const tradeEventId = sdk.addEventListener(\"tradeEvent\", (event, slot, signature) =\u003e {\n    console.log(\"tradeEvent\", event, slot, signature);\n  });\n  console.log(\"Subscribed to tradeEvent with ID:\", tradeEventId);\n\n  const completeEventId = sdk.addEventListener(\"completeEvent\", (event, slot, signature) =\u003e {\n    console.log(\"completeEvent\", event, slot, signature);\n  });\n  console.log(\"Subscribed to completeEvent with ID:\", completeEventId);\n};\n\nconst main = async () =\u003e {\n  try {\n    const provider = getProvider();\n    const sdk = new PumpFunSDK(provider);\n\n    // Set up event listeners\n    await setupEventListeners(sdk);\n  } catch (error) {\n    console.error(\"An error occurred:\", error);\n  }\n};\n\nmain();\n```\n\n#### Running the Event Subscription Example\n\nTo run the event subscription example, use the following command:\n\n```bash\nnpx ts-node example/events/events.ts\n```\n\n## Contributing\n\nWe welcome contributions! Please submit a pull request or open an issue to discuss any changes.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nBy following this README, you should be able to install the PumpDotFun SDK, run the provided examples, and understand how to set up event listeners and perform token operations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftexora%2Fpumpfun-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftexora%2Fpumpfun-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftexora%2Fpumpfun-bundler/lists"}