npm package: @heliofi/sdk
Description: A lightweight and easy-to-use SDK for interacting with the Helio API.
Author: Tigran Minasyan
Latest version: 3.0.3

# Helio SDK

## Introduction

A lightweight and easy-to-use SDK for interacting with the Helio API. Supports API key endpoints only.

It wraps and enhances the Helio API away into one NPM package which is easy to install and upgrade.

The Helio SDK is written in Typescript.

Please use the latest production version. Only used ALPHA versions if advised to do so.

## Installation

```
npm i @heliofi/sdk
```

or

```
yarn add @heliofi/sdk
```

<br>

**_IMPORTANT:_** You will also need to add the following line in your code, ideally at the very top of the project:

```
import 'reflect-metadata';
```

## Usage

```ts
import { HelioSDK } from '@heliofi/sdk';

const sdk = new HelioSDK({
  apiKey: 'your-public-api-key',
  secretKey: 'your-secret-key',
  network: 'mainnet', // or 'devnet' (optional, mainnet by default)
});

const paylink = await sdk.paylink.create(createPaylinkDto);

const paylinkWebhook = await sdk.paylinkWebhook.create(createPaylinkWebhookDto);
```

## Methods

| Methods                                           | Params                                                               | Return                          |
| ------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------- |
| **_Paylink_**                                     |
| paylink.create                                    | dto: CreatePaylinkWithApiDto                                         | ShallowEnrichedPaylink          |
| paylink.update                                    | paylinkId: string; dto: UpdatePaylinkWithApiDto                      | Paylink                         |
| paylink.disable                                   | paylinkId: string                                                    | boolean                         |
| **_Currency_**                                    |
| currency.getAllCurrencies                         | type?: CurrencyType                                                  | Currency[]                      |
| **_Transaction_**                                 |
| transaction.getTransaction                        | transactionSignature: string                                         | Transaction                     |
| transaction.getDepositTransaction                 | depositId: string; from?: string; to?: string; senderPK?: string     | Transaction                     |
| transaction.getDepositTransactionsByCustomerToken | customerToken: string; from?: string; to?: string; senderPK?: string | Transaction                     |
| **_Deposit_**                                     |
| deposit.create                                    | dto: CreateDepositCustomerDto                                        | DepositCustomerEntity           |
| deposit.recordActivity                            | tokenId: string                                                      | void                            |
| **_Deposit Webhook_**                             |
| depositWebhook.createDepositWebhook               | dto: CreateDepositHookByApiKeyDto                                    | DepositHook                     |
| **_Paylink Webhook_**                             |
| paylinkWebhook.createPaylinkWebhook               | dto: CreatePaylinkTransactionHookDto                                 | PaylinkTransactionHookEntity    |
| paylinkWebhook.getAllPaylinkWebhooks              | paylinkId: string                                                    | PaylinkTransactionHookEntity[]  |
| paylinkWebhook.getPaylinkWebhook                  | webhookId: string                                                    | PaylinkTransactionHookEntity    |
| paylinkWebhook.deletePaylinkWebhook               | webhookId: string                                                    | void                            |
| **_Subscription Webhook_**                        |
| subscriptionWebhook.createSubscriptionWebhook     | dto: CreatePaylinkSubscriptionHookDto                                | PaylinkSubscriptionHookEntity   |
| subscriptionWebhook.getAllSubscriptionWebhooks    | paylinkId: string                                                    | PaylinkSubscriptionHookEntity[] |
| subscriptionWebhook.getSubscriptionWebhook        | webhookId: string                                                    | PaylinkSubscriptionHookEntity   |
| subscriptionWebhook.deleteSubscriptionWebhook     | webhookId: string                                                    | void                            |
| **_Transaction Webhook_**                         |
| transactionWebhook.createTransactionWebhook       | dto: CreatePaylinkTransactionHookDto                                 | PaylinkTransactionHookEntity    |
| transactionWebhook.getAllTransactionWebhooks      | paylinkId: string                                                    | PaylinkTransactionHookEntity[]  |
| transactionWebhook.getTransactionWebhook          | webhookId: string                                                    | PaylinkTransactionHookEntity    |
| transactionWebhook.deleteTransactionWebhook       | webhookId: string                                                    | void                            |