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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gochufun-sdk

v1.3.8

Published

Buy/sell tokens on Gochu.fun

Readme

gochu-sdk

gochufun-sdk helps people trade and get token details on tokens on the gochu.fun platform. This package is designed to simplify the process of interacting with swap transactions and token details in a secure manner.

Installation

To install the package, use npm or yarn:

npm install gochufun-sdk

or

yarn add gochufun-sdk

Usage

Importing the Package

To use the gochufun-sdk, you need to import the necessary classes and interfaces:

import { GochuFun } from 'gochufun-sdk';
import { SwapTransaction } from 'gochufun-sdk/dist/interfaces/swapInterface';

Creating an Instance of Gochu

To create an instance of the GochuFun class, you need to provide a secretKey and an accessKey:

const gochu = new GochuFun({
    secretKey: 'your-secret-key',
    accessKey: 'your-access-key'
});

Swap Transaction

To perform a swap transaction, use the swapTransaction method. The SwapTransaction interface looks like this:

export interface SwapTransaction {
  amount: number;
  is_buy: boolean;
  min_output: number;
  token_mint: string;
}

Example usage:

const transaction: SwapTransaction = {
    amount: 100, // in sol for buy, in token value for sell
    is_buy: true,
    min_output: 95,
    token_mint: 'your-token-mint'
};

gochu.swapTransaction(transaction)
    .then(response => {
        console.log('Swap transaction successful:', response);
    })
    .catch(error => {
        console.error('Error performing swap transaction:', error);
    });

Get Quote

To get a quote for a swap transaction, use the getQuote method using the SimSwap interface

const transaction: SimSwap = {
  amount: 100;
  is_buy: true;
  token_mint: 'token address';
}
gochu.getQuote(transaction)
    .then(response => {
        console.log('Quote received:', response);
    })
    .catch(error => {
        console.error('Error getting quote:', error);
    });

Get Token Details

To get details of a token, use the getToken method. The TokenDetails interface looks like this:

export interface TokenDetails {
    token_mint: string;
}

Example usage:


const transaction = {
    token_mint: 'your-token-mint'
}

gochu.getToken(transaction)
        .then(response => {
                console.log('Token details:', response);
        })
        .catch(error => {
                console.error('Error getting token details:', error);
        });
gochu.getToken(transaction)
    .then(response => {
        console.log('Token details:', response);
    })
    .catch(error => {
        console.error('Error getting token details:', error);
    });

Launch Token

To launch a new token, use the createToken method. The LaunchToken interface looks like this:

export interface LaunchToken {
    image: File;
    tokenName: string;
    tokenTicker: string;
    tokenDescription: string;
    twitter?: string;
    website?: string;
    telegram?: string;
    twitch?: string;
    isAntiPvp: boolean;
}

Example usage:

const newToken: LaunchToken = {
    image: new File([''], 'token.png', { type: 'image/png' }),
    tokenName: 'MyToken',
    tokenTicker: 'MTK',
    tokenDescription: 'This is a description of MyToken.',
    twitter: 'https://x.com/mytoken',
    website: 'https://www.mytoken.com',
    telegram: 't.me/@mytokenchannel',
    twitch: 'twitch.com/mytokenchannel',
    isAntiPvp: true
};

gochu.createToken(newToken)
    .then(response => {
        console.log('Token launched successfully:', response);
    })
    .catch(error => {
        console.error('Error launching token:', error);
    });

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Contact

For any questions or support, please open an issue on the GitHub repository.