# @foly/helios-sdk

> A simple Software Development Kit to interact with the Helios bridgechain

Latest version **1.0.13** (published 2022-07-28) · CC BY-ND 4.0 license · 0 weekly downloads

## Install

```sh
npm install @foly/helios-sdk
pnpm add @foly/helios-sdk
yarn add @foly/helios-sdk
bun add @foly/helios-sdk
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2022-07-28 |
| First published | 2022-05-05 |
| Weekly downloads | 0 |
| License | CC BY-ND 4.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16.0.0 <17 |
| Dependencies | 7 |
| Unpacked size | 37.7 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | emsy |

## Links

- npm: https://www.npmjs.com/package/@foly/helios-sdk
- npm.io page: https://npm.io/package/@foly/helios-sdk

## Dependencies (7)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.0
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^4.5.0
- [@foly/helios-crypto](https://npm.io/package/@foly/helios-crypto.md) 3.2.1-next.1
- [@arkecosystem/crypto](https://npm.io/package/@arkecosystem/crypto.md) 3.3.2
- [@solar-network/crypto](https://npm.io/package/@solar-network/crypto.md) 3.2.1

## Recent versions

- 1.0.13 (latest) — 2022-07-28
- 1.0.12 — 2022-07-21
- 1.0.10 — 2022-06-03
- 1.0.9 — 2022-06-02
- 1.0.8 — 2022-06-02
- 1.0.7 — 2022-06-02
- 1.0.6 — 2022-06-02
- 1.0.5 — 2022-06-02
- 1.0.4 — 2022-06-02
- 1.0.3 — 2022-06-02
- 1.0.2 — 2022-06-02
- 1.0.0 — 2022-05-27
- 0.0.2 — 2022-05-05

## README

# Helios SDK

Helios SDK is a simple Software Development Kit to interact with the Helios bridgechain. 

### Features
- Easily broadcast transactions.
- Automatic crypto config handling.
- Automatic nonce handling.
- Sign and verify crypto messages with easy.
- Listen to real-time blockchain events with ease.

### Prerequisites
- pnpm
- NodeJS version 16.x

## Usage
### Installation
```shell
pnpm install @foly/helios-sdk
```
### Configuration
Feel free to override the following default configuration to your own likings using a `.env` file.
```dotenv
CACHE_WALLET_DURATION=10000
CACHE_NONCE_DURATION=10000
TRANSACTION_AMOUNT=100000
TRANSACTION_FEE=100000
API_ENDPOINT=https://api.heliosblockchain.io
SOCKET_ENDPOINT=https://socket.heliosblockchain.io
```

### Send transfer transaction
```javascript
const SDK = require('@foly/helios-sdk');

await SDK.initialize();
await SDK.Api.Helios.sendTransferTransaction(
    recipientId, 
    mnemonic, 
    amount, 
    vendorField
);
```
### Send authentication transaction
```javascript
const SDK = require('@foly/helios-sdk');

await SDK.initialize();
await SDK.Api.Helios.sendAuthenticationTransaction(
    recipientId,
    isLoggedIn,
    mnemonic,
);
```
### Send character registration transaction
```javascript
const SDK = require('@foly/helios-sdk');

await SDK.initialize();
await SDK.Api.Helios.sendCharacterRegistrationTransaction(
    recipientId,
    {
        name: 'name',
        classId: 1
    },
    mnemonic,
);
```
### Get wallet
```javascript
const SDK = require('@foly/helios-sdk');

await SDK.initialize();

const wallet = await SDK.Api.Helios.getWallet(address);
```
### Search for transactions
```javascript
const SDK = require('@foly/helios-sdk');

await SDK.initialize();

const response = await SDK.Api.Helios.searchTransactions(queryString);
```
The query parameters can be found at [ARK's documentation](https://ark.dev/docs/api/public-rest-api/endpoints/transactions#list-all-transactions).
### Sign and verify a crypto message
```javascript
const SDK = require('@foly/helios-sdk');

SDK.Secret.create(publicKey, 'message');

const ecdsa = SDK.Secret.signEcdsa(publicKey, mnemonic).signature;
const schnorr = SDK.Secret.signSchnorr(publicKey, mnemonic).signature;
const isVerified = SDK.Secret.verifyEcdsa(publicKey, ecdsa);
const isVerified = SDK.Secret.verifySchnorr(publicKey, schnorr);
```
### Listen to real-time Helios blockchain events
```javascript
const SDK = require('@foly/helios-sdk');

const heliosSocket = await SDK.Socket.Builders.BuilderFactory.helios();

heliosSocket.connect();
heliosSocket.on('block.applied', data => console.log(data));
```
## Credits

- [e-m-s-y](https://github.com/e-m-s-y) - maintainer of this project.
- [Solar-network](https://github.com/Solar-network) - for providing Solar Core.

## License

[CC BY-ND 4.0](LICENSE.md)

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