npm package: @kaddex/kaddex-sdk
Description: Functional library for interacting with kaddex smart contracts on kadena chainweb blockchain via the pact-lang-api.
Author: kaddex
Latest version: 0.0.1

# :hammer_and_wrench: Kaddex SDK

![Test suite](https://github.com/roboswap-ai/kaddex-sdk/workflows/Test%20suite/badge.svg)
[![Build Status](https://travis-ci.org/jankapunkt/npm-package-template.svg?branch=master)](https://travis-ci.org/roboswap-ai/kaddex-sdk)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![GitHub](https://img.shields.io/github/license/roboswap-ai/kaddex-sdk)

The Kaddex SDK is a stand-alone library designed to assist developers when interacting with the protocol in any environment that can execute JavaScript, such as websites or node scripts.

## INSTRUCTIONS

For general usage, refer to our documentation on gitbook:

[https://docs.kaddex.com/kaddex-sdk/](https://docs.kaddex.com/kaddex-sdk/)

## SDK Developers (Contributors)

### Getting started

First step, clone the repository, and change into the project directory

```bash
$ git clone https://github.com/roboswap-ai/kaddex-sdk.git
```

```bash
$ cd kaddex-sdk
```

Install NPM packages for local development

```bash
$ npm install
```

Duplicate the .env.example file for local development

```bash
$ cp .env.example .env
```

Now, you'll need to generate a local key pair for integration testing on the Kadena Chainweb testnet.

```bash
$ npm run keygen
```

Copy this key pair into your .env file.

Next, use the testnet faucet to send some Testnet KDA to your new public key (ensure you use the public key as the account name): https://faucet.testnet.chainweb.com/

Finally, you will need to transfer some coins to chain ID 0 in order to run the integration tests.

Open Chainweaver here: https://chainweaver.kadena.network/

Create a new Chainweaver account if necessary.

Ensure you are on the testnet in Chainweaver.

Click "Add Account" and paste your public key.

If your testnet faucet transaction is complete, you should already see your Testnet KDA deposited.

Click "Transfer" in order to send some coins to chain ID 0.

Wait for your transfer to complete and ensure Chainweaver shows your new balance on chain ID 0.

Now, you are ready to run the integration tests using your new keypair.

```bash
$ npm run test
```

All tests should pass. Otherwise, notify the repository owners! ;)

You should now be all set for local development. Congrats! :party-popper:

In order to test the end-to-end functionality on the testnet, run the test command with `nock` disabled.

```bash
$ NOCK_OFF=true npm run test
```

### Code Quality

We use `eslint`.

You can run lint in two modes:

##### lint

```bash
$ npm run lint
```

##### lint with auto fixing

```bash
$ npm run lint:fix
```

### Run the tests

We use mocha and chai with a mostly (but not strict) behavioral style for testing.

You can run the tests in three different contexts:

##### Single run

```bash
$ npm run test
```

##### Watch mode

```bash
$ npm run test:watch
```

##### Coverage

```bash
$ npm run test:coverage
```

### Documentation

Documentation is using jsDoc and is available as [html](docs/index.html) or [markdown](api.md) version.

To build the documentation in development, you need to run

```bash
$ npm run docs
```

### License

MIT, see [license file](LICENSE)