open-index/open-npm huggingface dataset:
npm package: @gemuni/sdk
Description: 🛠 An SDK for building applications on top of gemuni.
Latest version: 1.0.22

# Gemuni SDK

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://gitlab.com/gemuni/gemuni-dex-subs/gemuni-sdk.git
```

Move into the gemuni-sdk working directory

```sh
cd gemuni-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @gemunion/eslint-config
Description: This is sharable ESLint config which we use across of all our repositories. It is amazing.
Author: TrejGun
Latest version: 5.0.1

# ESLint config

This is sharable ESLint config which we use across of all our repositories. It is amazing.

### Usage

eslint.config.mjs

```js
import typescriptRules from "./presets/tsx.mjs";

export default [
  ...typescriptRules,
];
```
npm package: @gemunion/nestjs-sqs
Description: Tested with: [AWS SQS](https://aws.amazon.com/en/sqs/) and [ElasticMQ](https://github.com/softwaremill/elasticmq).
Author: TrejGun
Latest version: 4.0.2

# NestJS SQS

Tested with: [AWS SQS](https://aws.amazon.com/en/sqs/) and [ElasticMQ](https://github.com/softwaremill/elasticmq).

NestJS SQS is a project to make SQS easier to use and control some required flows with NestJS. This module provides
decorator-based message handling suited for simple use.

This library internally relies on [bbc/sqs-producer](https://github.com/bbc/sqs-producer)
and [bbc/sqs-consumer](https://github.com/bbc/sqs-consumer), and implements some more useful features on top of the
basic functionality given by them.

## Installation

```shell script
$ npm i --save @gemunion/nestjs-sqs
```

## Quick Start

### Register custom transport

Just like you register any other microservice

```ts
import { SQSClient } from "@aws-sdk/client-sqs";
import { SqsServer } from "@gemunion/nestjs-sqs";

const sqs = new SQSClient({
  endpoint: "http://localhost:9324",
  region: "none",
  credentials: {
    accessKeyId: "x",
    secretAccessKey: "x",
  },
});

app.connectMicroservice({
  strategy: new SqsServer({
    consumerOptions: {
      sqs,
      queueUrl: "http://localhost:9324/queue/producer.fifo",
    },
    producerOptions: {
      sqs,
      queueUrl: "http://localhost:9324/queue/consumer.fifo",
    },
  }),
});
```

### Decorate methods

You need to decorate methods in your NestJS controller in order to have them be automatically attached as event handlers
for incoming SQS messages:

```ts
@Controller()
export class SqsController {
  @MessagePattern(MESSAGE_TYPE)
  public handleMessage(message: any): Promise<any> {
    // do something, return result
  }

  @EventPattern(EVENT_TYPE)
  public handleEvent(event: any): Promise<void> {
    // do something
  }
}
```

### Produce messages

```ts
import { SQSClient } from "@aws-sdk/client-sqs";
import { SqsClient, SQS_SERVICE } from "@gemunion/nestjs-sqs";

const sqs = new SQSClient({
  endpoint: "http://localhost:9324",
  region: "none",
  credentials: {
    accessKeyId: "x",
    secretAccessKey: "x",
  },
});

@Module({
  imports: [
    ClientsModule.register([
      {
        name: SQS_SERVICE,
        customClass: SqsClient,
        options: {
          consumerUrl: "http://localhost:9324/queue/consumer.fifo",
          producerUrl: "http://localhost:9324/queue/producer.fifo",
          sqs,
        },
      },
    ]),
  ],
  providers: [AppService],
})
class AppModule {
}

export class AppService {
  constructor(
    @Inject(SQS_SERVICE)
    private readonly sqsClientProxy: ClientProxy,
  ) {
  }

  public dispatch(): Promise<void> {
    void this.client.emit(EVENT_NAME, {});
  }
}
```

### Code quality

Terminal 1

```sh
java -Dconfig.file=.github/build/elasticmq.conf -jar elasticmq-server-1.3.9.jar
```

Terminal 2

```sh
npm t
```

## License

This project is licensed under the terms of the MIT license.