# @godex/widget

> ## Description

Latest version **0.0.1** (published 2023-11-21) · 0 weekly downloads

## Install

```sh
npm install @godex/widget
pnpm add @godex/widget
yarn add @godex/widget
bun add @godex/widget
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2023-11-21 |
| First published | 2023-11-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | godex |

## Links

- npm: https://www.npmjs.com/package/@godex/widget
- npm.io page: https://npm.io/package/@godex/widget

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Recent versions

- 0.0.1 (latest) — 2023-11-21

## 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

```bash
npm install @godex/widget
```

## Usage

Importing

```javascript
import { GodexWidget } from '@godex/widget';
```

Creating an Instance

```javascript
const godex = new GodexWidget();
```

## Examples
Getting a List of Coins

```javascript
godex.getCoins({ page: 1, limit: 10, onlyActive: true })
  .then(response => console.log(response))
  .catch(error => console.error(error));
```

Getting Information About a Currency Pair

```javascript
godex.getPairInfo({ from: 'BTC', to: 'ETH', amount: '1.0' })
  .then(response => console.log(response))
  .catch(error => console.error(error));
```

Creating a Transaction

```javascript
const transactionArgs = {
  // Your transaction arguments
};
godex.createTransaction(transactionArgs)
  .then(response => console.log(response))
  .catch(error => console.error(error));
```

Tracking Transaction Changes

```javascript
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.

---
_Source: https://npm.io/package/@godex/widget · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
