@godex/widget
v0.0.1
Published
## Description
Downloads
1
Readme
@godex/widget
Description
@godex/widget
is a powerful and flexible NPM library for interacting with the Godex cryptocurrency exchange API. This library enables easy integration of cryptocurrency exchange functions into your application, providing access to operations such as retrieving coin pair information, creating, and tracking transactions.
Features
getCoins(args?: IGetCoinsArgs)
: Retrieve a list of available coins.getPairInfo(args?: IPairInfoArgs)
: Get information about a currency pair.getTransactionById(id: string)
: Retrieve transaction information by ID.createTransaction(args?: ICreateTransactionArgs)
: Create a transaction.subscribeOnTransactionChanges(id: string, cb: () => void)
: Subscribe to transaction status changes.unsubscribeFromTransactionChanges(id: string)
: Unsubscribe from transaction status changes.
Installation
npm install @godex/widget
Usage
Importing
import { GodexWidget } from '@godex/widget';
Creating an Instance
const godex = new GodexWidget();
Examples
Getting a List of Coins
godex.getCoins({ page: 1, limit: 10, onlyActive: true })
.then(response => console.log(response))
.catch(error => console.error(error));
Getting Information About a Currency Pair
godex.getPairInfo({ from: 'BTC', to: 'ETH', amount: '1.0' })
.then(response => console.log(response))
.catch(error => console.error(error));
Creating a Transaction
const transactionArgs = {
// Your transaction arguments
};
godex.createTransaction(transactionArgs)
.then(response => console.log(response))
.catch(error => console.error(error));
Tracking Transaction Changes
godex.subscribeOnTransactionChanges('transactionId', () => {
console.log('Transaction status changed');
});
// To unsubscribe
godex.unsubscribeFromTransactionChanges('transactionId');
API Documentation
For detailed API documentation and available features, visit Godex API Documentation.
Support
If you have any questions or issues related to using the library, please contact our support team.