npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

predator-sdk

v1.0.0

Published

SDK for interacting with Predator Bundler API

Downloads

69

Readme

Javascript PredatorSDK Documentation

Introduction

PredatorSDK is a JavaScript library designed to interact with the Predator Bundler API. It provides functionality for buying, selling on Raydium, Moonshot and pump.fun. You can also create a token on pump.fun.

Installation

Start downloading this repo with git.

git clone https://github.com/predatordotbot/bundler-node-sdk

Install required node modules.

npm i

Usage

You can start editing example.js for your needs and start code using: node example.js. Be sure to rename example.env to .env after updating it with your data.

Initializing the SDK

const PredatorSDK = require('predator-sdk');
const sdk = new PredatorSDK();

Buying Tokens

To buy tokens:

async function buyTokens() {
  try {
    const buyResult = await sdk.buy({
      privateKeys: 'privatekey1,privatekey2',
      tokenAddress: 'token-address',
      amount: '0.001', // Amount in SOL to buy on each wallet
    });
    console.log('Buy successful:', buyResult);
  } catch (error) {
    console.error('Buy operation failed:', error.message);
  }
}

Selling Tokens

To sell tokens:

async function sellTokens() {
  try {
    const sellResult = await sdk.sell({
      privateKeys: 'privatekey1,privatekey2',
      tokenAddress: 'token-address',
      percentage: '100', // Percentage to sell for each wallet
    });
    console.log('Sell successful:', sellResult);
  } catch (error) {
    console.error('Sell operation failed:', error.message);
  }
}

Creating Tokens

To create a new token:

async function createToken() {
  try {
    const createResult = await sdk.create({
      privateKeys: 'privatekey1,privatekey2',
      devPrivateKey: 'privatekey',
      amount: '0.01', // Amount in SOL to buy on each wallet
      name: 'My Token',
      symbol: 'MTK',
      description: 'A sample token',
      telegram: 'https://t.me/mytoken',
      twitter: 'https://twitter.com/mytoken',
      website: 'https://mytoken.com',
      file: 'https://example.com/token-logo.png',
    });
    console.log('Token creation successful:', createResult);
  } catch (error) {
    console.error('Token creation failed:', error.message);
  }
}

Fees

To guarantee transactions a successful landing our api will charge 0.005 SOL each successful request + 2.5% of SOL bought or sold. This will cover any blockchain fee.

Security Considerations

  • Never share your private keys or store them in plain text.
  • Use environment variables or secure key management solutions to store sensitive information.
  • Be cautious when interacting with smart contracts and always verify the addresses you're interacting with.

Error Handling

The SDK uses a custom error handling mechanism. Always wrap your calls in try-catch blocks to handle potential errors gracefully.