JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q49443F
  • License ISC

Buy/sell tokens on Gochu.fun

Package Exports

  • gochufun-sdk

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/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:

const transaction: SwapTransaction = {
    // transaction details
};

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:

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:

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

Contributing

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

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

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