<p></p>

<div align="center"><img alt="" src="img/q-logo.png" width="128"></div>

<div align="center"><h1>GDK SDK</h1></div>

<div align="center">

**[Documentation](https://q-dev.gitlab.io/q-gdk/gdk-sdk/latest/)** •
**[GDK Contracts](https://gitlab.com/q-dev/q-gdk/gdk-contracts)** •
**[Q Blockchain](https://q.org)**

</div>

<div align="center"><p>Typescript Library to interact with GDK Contracts</p></div>

<div align="center"></div>

## Installation

Install package as dependency:

```bash
npm install --save @q-dev/q-gdk/gdk-sdk
```

or

```bash
yarn add @q-dev/q-gdk/gdk-sdk
```

### Requirements

* [Web3 ^1.8.0](https://www.npmjs.com/package/web3)

## Local development

### Install packages

```bash
npm install
```

### Generate types

```bash
npm run generate-types
```

If generate-types indicates 0 matching files (on Windows machines) you can try the adapted script `npm run generate-types-win`

### Contribute

Make sure to run `pre-commit` script before commit

```bash
npm run pre-commit
```

### Run tests

You may run tests via

```bash
npm run test
```

### Get access to private Gitlab registry

Log in to GitLab NPM package registry. You need a gitlab personal access token with `read_api` option enabled. This can be created via [GitLab User Settings / Access Tokens](https://gitlab.com/-/profile/personal_access_tokens).

```bash
npm config set '//gitlab.com/api/v4/packages/npm/:_authToken' <YOUR_ACCESS_TOKEN>
```

Furthermore, you need to tell npm that all `q-dev` packages should be resolved via private gitlab registry. Create a file `.npmrc` with the following content:

```
@q-dev:registry=https://gitlab.com/api/v4/packages/npm/
```

## Code of Conduct

This project and everyone participating in it is governed by the
[GDK SDK Code of Conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code.

## Resources

* [Changelog](CHANGELOG.md)
* [Contributing Guide](CONTRIBUTING.md)
* [GDK Contracts](https://gitlab.com/q-dev/q-gdk/gdk-contracts)
* [Web3 Documentation](https://web3js.readthedocs.io/en/v1.8.0/)

## License

[LGPL-3.0](LICENSE)
