open-index/open-npm huggingface dataset:
npm package: @rosen-bridge/interval-timer
Description: this project contains interval timer class which can be used to run functions at specific intervals
Author: Rosen Team
Latest version: 0.1.0

# @rosen-bridge/interval-timer

<p align="center">
  <a href="https://www.npmjs.com/package/@rosen-bridge/interval-timer"><img src="https://img.shields.io/npm/v/@rosen-bridge/interval-timer"></a>
  <img src="https://img.shields.io/npm/l/@rosen-bridge/interval-timer"></a>
<p>

## Table of contents

- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)

## Description

`IntervalTimer` is a TypeScript class designed for managing the periodic execution of asynchronous callbacks at specified intervals. It ensures that the callback runs only once within a given interval, preventing overlapping executions.

## Key Functionalities

- **Asynchronous Execution**: The timer can handle asynchronous callbacks, allowing for non-blocking operation.
- **Customizable Intervals**: Supports custom execution-interval and check-interval, if the execution of an async callback take more time than execution-interval the check-interval is used to detect when the callback has resolved and immediately runs the callback again.
- **Error Rethrow**: The run-loop of the IntervalTimer does not catch the errors, errors should be handled inside the callback function.

## Installation

```bash
npm install @rosen-bridge/interval-timer
```

## Usage

```ts
import IntervalTimer from '@rosen-bridge/interval-timer';

// Example callback function that returns a promise
const myAsyncCallback = async () => {
  console.log('Timer executed at', new Date().toLocaleTimeString());
  // Simulate async work
  await new Promise((resolve) => setTimeout(resolve, 1000));
};

// Create a new instance of IntervalTimer with a 5 second interval
const timer = new IntervalTimer(5000, myAsyncCallback);

// Start the timer
timer.start();

// To stop the timer, call: timer.stop();
```
npm package: @rosen-bridge/json-bigint
Description: A wrapper to json-bigint package with pre-set configurations
Author: Rosen Team
Latest version: 1.1.0

# @rosen-bridge/json-bigint

## Table of contents

- [@rosen-bridge/json-bigint](#rosen-bridgejson-bigint)
  - [Table of contents](#table-of-contents)
  - [Introduction](#introduction)
  - [Installation](#installation)
- [Usage](#usage)

## Introduction

A wrapper to json-bigint package with pre-set configurations

## Installation

npm:

```sh
npm i @rosen-bridge/json-bigint
```

yarn:

```sh
yarn add @rosen-bridge/json-bigint
```

# Usage

```ts
import JsonBigInt from '@rosen-bridge/json-bigint';

const json = {
  a: 100000000000000000000n,
  b: 1n,
};
const jsonString = '{"a":100000000000000000000,"b":1}';

const parsedJson = JsonBigInt.parse(jsonString);
const stringifiedJson = JsonBigInt.stringify(json);
```
npm package: @rosen-bridge/log-level-check
Description: Rosen bridge log-level health-check parameter
Author: Rosen Team
Latest version: 4.0.0

# log-level-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge log-level health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/log-level-check
```

yarn:

```sh
yarn add @rosen-bridge/log-level-check
```
npm package: @rosen-bridge/minimum-fee
Description: this project gets minimum fee of the bridge for supported tokens from blockchain
Author: Rosen Team
Latest version: 4.0.0

# @rosen-bridge/minimum-fee

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

`@rosen-bridge/minimum-fee` Typescript package to build and get minimum fee of the bridge for supported tokens from blockchain

## Installation

npm:

```sh
npm i @rosen-bridge/minimum-fee
```

yarn:

```sh
yarn add @rosen-bridge/minimum-fee
```

#### Examples

**TODO**
npm package: @rosen-bridge/node-sync-check
Description: Rosen bridge node-sync health-check parameter
Author: Rosen Team
Latest version: 3.0.1

# @rosen-bridge/node-sync-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge node-sync health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/node-sync-check
```

yarn:

```sh
yarn add @rosen-bridge/node-sync-check
```
npm package: @rosen-bridge/observation-extractor
Description: Event observation data extractor for different chains
Author: Rosen Team
Latest version: 7.1.4

# Observation Extractor

### Table of Contents

- [Description](#description)
- [Related Projects](#related-projects)
- [How to Use the Observation Extractor](#how-to-use-the-observation-extractor)
  - [Install](#install)
  - [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

<a name="headers"/>

## Description

Data extractors are modules that are integrated within a scanner. They drive the required information from the scanned blocks and store them in their own database. The observation extractor is designed to fulfill a watcher's main task: observing user payments in source networks. The bridge payment transaction has its own structure, and the observation extractor searches for this pattern occurrence in source chains and stores all needed information for a watcher commitment creation and revealment.

## Related Projects

This module is used within the [Scanner](https://github.com/rosen-bridge/scanner) project. The address scanner is currently used in the [Watcher](https://github.com/rosen-bridge/watcher) service to drive the valid source chain observations.

## How to Use the Observation Extractor

### Install

This project is written in node-js using Esnext module and typeorm database. Extractors are not standalone projects and should be used as scanner modules. You can easily install it using npm with the command:

```shell
npm install @rosen-bridge/observation-extractor
```

Alternatively, you can build and use it manually by cloning the project and running:

```shell
npm install
npm run build
```

### Usage

In the first step, you need to create a scanner instance; follow the steps [here](https://github.com/rosen-bridge/scanner) to create a running instance of the scanner. Then you need to instantiate your address extractor and register it to your scanner:

```javascript
const ergoObsesrvationExtractor = new ErgoObservationExtractor(
   dataSource,
   <tokens.json>,
   <lock_address>
)
ergoScanner.registerExtractor(ergoObsesrvationExtractor)
```

Where the `token.json` is a source-target map of token ids that are exchanged in the bridge.

Or similarly for cardano:

```javascript
const cardanoObsesrvationExtractor = new CardanoObservationExtractor(
    dataSource,
    <tokens.json>,
    <lock_address>
)
cardanoScanner.registerExtractor(cardanoObsesrvationExtractor)
```

## Contributing

TBD

## License

TBD
npm package: @rosen-bridge/p2p-network-check
Description: Rosen bridge p2p-network health-check parameter
Author: Rosen Team
Latest version: 3.0.0

# @rosen-bridge/p2p-network-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge p2p-network health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/p2p-network-check
```

yarn:

```sh
yarn add @rosen-bridge/p2p-network-check
```
npm package: @rosen-bridge/permit
Description: A package for managing permit boxes
Author: Rosen Team
Latest version: 1.1.0

# @rosen-bridge/permit

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

A package for managing permit boxes

## Installation

npm:

```sh
npm i @rosen-bridge/permit
```

yarn:

```sh
yarn add @rosen-bridge/permit
```
npm package: @rosen-bridge/permit-check
Description: Rosen bridge permit health-check parameter
Author: Rosen Team
Latest version: 3.0.2

# @rosen-bridge/permit-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge permit health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/permit-check
```

yarn:

```sh
yarn add @rosen-bridge/permit-check
```
npm package: @rosen-bridge/query-params
Description: A type-safe URL filter parser that converts query parameters into validated field, sort, and pagination objects
Author: Rosen Team
Latest version: 0.0.0

# @rosen-bridge/query-params

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

A type-safe URL filter parser that converts query parameters into validated field, sort, and pagination objects

## Installation

npm:

```sh
npm i @rosen-bridge/query-params
```

yarn:

```sh
yarn add @rosen-bridge/query-params
```

## Usage

To use the `FilterParser`, configure it with your allowed fields, sorts, and pagination rules:

```ts
import { FilterParser } from '@rosen-bridge/query-params';

const filterParser = new FilterParser({
  fields: {
    enable: true,
    items: [
      {
        key: 'field1',
        type: 'string',
        operators: ['equal'],
        values: ['value1', 'value2'],
      },
      {
        key: 'field2',
        type: 'string',
        operators: ['contains'],
      },
    ],
  },
  pagination: {
    enable: true,
    limit: {
      min: 1,
      max: 100,
      default: 10,
    },
    offset: {
      min: 0,
      max: 1000,
      default: 0,
    },
  },
  sorts: {
    enable: true,
    items: [
      {
        key: 'key1',
      },
      {
        key: 'key2',
        defaultOrder: 'ASC',
      },
    ],
  },
});

const filter = filterParser.parse(request.url);
```
npm package: @rosen-bridge/raw-data-provider
Description: This package populates missing rawData values for extractors records stored in the database.
Author: Rosen Team
Latest version: 0.1.1

# @rosen-bridge/raw-data-provider

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

This package populates missing rawData values for extractors records stored in the database.

## Installation

npm:

```sh
npm i @rosen-bridge/raw-data-provider
```

yarn:

```sh
yarn add @rosen-bridge/raw-data-provider
```
npm package: @rosen-bridge/reward-extractor
Description: Extract reward transactions data
Author: Rosen Team
Latest version: 0.0.0

# @rosen-bridge/reward-extractor

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Extract reward transactions data

## Installation

npm:

```sh
npm i @rosen-bridge/reward-extractor
```

yarn:

```sh
yarn add @rosen-bridge/reward-extractor
```
npm package: @rosen-bridge/rosenet-node
Description: Rosen Bridge RoseNet node
Author: Rosen Team
Latest version: 0.4.0

# @rosen-bridge/rosenet-node

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen Bridge RoseNet node

## Installation

npm:

```sh
npm i @rosen-bridge/rosenet-node
```

yarn:

```sh
yarn add @rosen-bridge/rosenet-node
```
npm package: @rosen-bridge/rosenet-relay
Description: Rosen Bridge RoseNet relay
Author: Rosen Team
Latest version: 0.3.0

# @rosen-bridge/rosenet-relay

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen Bridge RoseNet relay

## Installation

npm:

```sh
npm i @rosen-bridge/rosenet-relay
```

yarn:

```sh
yarn add @rosen-bridge/rosenet-relay
```
npm package: @rosen-bridge/runes-observation-extractor
Description: Event observation data extractor for Runes chain
Author: Rosen Team
Latest version: 0.2.0

# @rosen-bridge/runes-observation-extractor

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Event observation data extractor for Runes chain

## Installation

npm:

```sh
npm i @rosen-bridge/runes-observation-extractor
```

yarn:

```sh
yarn add @rosen-bridge/runes-observation-extractor
```
npm package: @rosen-bridge/scanner
Description: A Blockchain scanner. currently supports ergo and cardano
Author: Rosen Team
Latest version: 8.0.1

# Scanner

### Table of Contents

- [Description](#description)
- [Related Projects](#related-projects)
- [How to Use the Scanner](#how-to-use-the-scanner)
  - [Install](#install)
  - [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
  <a name="headers"/>

## Description

Scanner is a bridge component responsible for observing and tracking the latest blocks in a target networks.

The goal of this project is to create an infrastructure for other projects. Bridge services, like watcher and guard, use this component to track the needed information. Moreover, this library can be utilized in other projects rather than bridge-related services to make them independent of the ergo explorer. It would help the network to be as decentralized as possible.

While the scanner itself only tracks the latest target network blocks, you can register a data extractor to the scanner to save your required data. In Rosen bridge, we use 4 different extractors on top of the scanner to extract bridge information. Check out these extractors [here](https://github.com/orgs/rosen-bridge/repositories).

## Related Projects

As mentioned above, data extractors can be added to the scanner to extract and store all required information. Finally, these components are used in the [Watcher](https://github.com/rosen-bridge/watcher) and [Guard](https://github.com/rosen-bridge/ts-guard-service) services.

## How to Use the Scanner

### Install

This project is written in node-js using Esnext module and typeorm database. Since the scanner is a core service, it's not designed to be used independently. However, you can easily install and use this library in your projects by running:

```shell
npm i @rosen-bridge/scanner
```

Additionally, it is possible to build this project manually as well. In order to build the project, clone the scanner repo and follow these steps:

```shell
npm install
npm run build
```

### Usage

Ergo Scanner:

```javascript
const ergoScannerConfig = {
    nodeUrl: <node_url>,
    timeout: <node_timeout>,
    initialHeight: <ergo_initial_height>,
    dataSource: dataSource,
}
scanner = new ErgoScanner(ergoScannerConfig);
```

Cardano Scanner:

```javascript
const cardanoScannerConfig = {
    koiosUrl: <koios_url>,
    timeout: <api_timeout>,
    initialHeight: <cardano_initial_height>,
    dataSource: dataSource,
}
cardanoScanner = new CardanoKoiosScanner(cardanoScannerConfig)
```

Registering data extractor:

```javascript
const dataExtractor = new DataExtractor(dataSource, <PARAMETERS>)
scanner.registerExtractor(dataExtractor)
```

## Contributing

TBD

## License

TBD
npm package: @rosen-bridge/scanner-interfaces
Description: Defines all scanner interfaces
Author: Rosen Team
Latest version: 0.2.2

# @rosen-bridge/scanner-interfaces

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Defines all scanner interfaces

## Installation

npm:

```sh
npm i @rosen-bridge/scanner-interfaces
```

yarn:

```sh
yarn add @rosen-bridge/scanner-interfaces
```
npm package: @rosen-bridge/scanner-sync-check
Description: Rosen bridge scanner-sync health-check parameter
Author: Rosen Team
Latest version: 8.2.0

# @rosen-bridge/scanner-sync-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge scanner-sync health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/scanner-sync-check
```

yarn:

```sh
yarn add @rosen-bridge/scanner-sync-check
```
npm package: @rosen-bridge/sdk-abstract
Description: Abstract interface for rosen chain SDKs
Author: Rosen Team
Latest version: 0.1.0

# @rosen-bridge/sdk-abstract

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Abstract interface for rosen chain SDKs

## Installation

npm:

```sh
npm i @rosen-bridge/sdk-abstract
```

yarn:

```sh
yarn add @rosen-bridge/sdk-abstract
```
npm package: @rosen-bridge/sdk-constant
Description: A Typescript package containing shared constants and utilities of Rosen SDK packages
Author: Rosen Team
Latest version: 0.1.0

# @rosen-bridge/sdk-constant

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

A Typescript package containing shared constants and utilities of Rosen SDK packages.

## Installation

npm:

```sh
npm i @rosen-bridge/sdk-constant
```

yarn:

```sh
yarn add @rosen-bridge/sdk-constant
```
npm package: @rosen-bridge/sdk-utils
Description: This project includes utils functions that clients or chain sdks require to interact with
Author: Rosen Team
Latest version: 0.1.0

# @rosen-bridge/sdk-utils

## Table of contents

- [@rosen-bridge/sdk-utils](#rosen-bridgesdk-utils)
  - [Table of contents](#table-of-contents)
  - [Introduction](#introduction)
  - [Installation](#installation)
  - [Usage](#usage)
    - [Generate Rosen Data](#generate-rosen-data)

## Introduction

This project includes utils functions that clients or chain sdks require to interact with.

## Installation

npm:

```sh
npm i @rosen-bridge/sdk-utils
```

yarn:

```sh
yarn add @rosen-bridge/sdk-utils
```

## Usage

### Generate Rosen Data

```typescript
import { encodeAddress } from '@rosen-bridge/address-codec';
import { NETWORKS } from '@rosen-bridge/sdk-constant';

const toChain = NETWORKS.EXAMPLE_CHAIN;
const toEncodedAddress = encodeAddress(toChain, toExampleChainAddress);
const hex = generateRosenData(toChain, toEncodedAddress, 153n, 9551n);

console.log(hex);
```
npm package: @rosen-bridge/selection-types
Description: A Typescript package containing types of general UTxO selection
Author: Rosen Team
Latest version: 1.0.1

# @rosen-bridge/selection-types

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)

## Introduction

A Typescript package for general UTxO selection, providing an all required types of `@rosen-bridge/abstract-box-selection`.

## Installation

npm:

```sh
npm i @rosen-bridge/selection-types
```

yarn:

```sh
yarn add @rosen-bridge/selection-types
```
npm package: @rosen-bridge/token-price-entity
Description: Token price history tracking entity and migrations
Author: Rosen Team
Latest version: 0.2.1

# @rosen-bridge/token-price-entity

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Token price history tracking entity and migrations

## Installation

npm:

```sh
npm i @rosen-bridge/token-price-entity
```

yarn:

```sh
yarn add @rosen-bridge/token-price-entity
```
npm package: @rosen-bridge/tss
Description: TypeScript library for building and validating TSS signatures.
Author: Rosen Team
Latest version: 5.1.0

# @rosen-bridge/tss

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

`@rosen-bridge/tss` TypeScript library for building and validating TSS signatures.

## Installation

npm:

```sh
npm i @rosen-bridge/tss
```

yarn:

```sh
yarn add @rosen-bridge/tss
```
npm package: @rosen-bridge/tx-progress-check
Description: Rosen bridge tx-progress health-check parameter
Author: Rosen Team
Latest version: 3.0.0

# @rosen-bridge/tx-progress-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge tx-progress health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/tx-progress-check
```

yarn:

```sh
yarn add @rosen-bridge/tx-progress-check
```
npm package: @rosen-bridge/utils
Description: Misc utility functions used inside Rosen bridge projects
Author: Rosen Team
Latest version: 3.0.0

# @rosen-bridge/utils

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

`@rosen-bridge/utils` contains some common utility functions and apis that are used
inside other Rosen bridge projects.

## Installation

npm:

```sh
npm i @rosen-bridge/utils
```

yarn:

```sh
yarn add @rosen-bridge/utils
```
npm package: @rosen-bridge/watcher-data-extractor
Description: Extractor for rosen specific boxes on ergo blockchain
Author: Rosen Team
Latest version: 13.0.4

# Watcher Data Extractor

### Table of Contents

- [Description](#description)
- [Related Projects](#related-projects)
- [How to Use the Watcher Data Extractor](#how-to-use-the-watcher-data-extractor)
  - [Install](#install)
  - [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

<a name="headers"/>

## Description

Data extractors are modules that are integrated within a scanner. They drive the required information from the scanned blocks and store them in their own database. The watcher data extractor is responsible for tracking all watcher-related data in the network. These data includes permit, commitment and event trigger boxes; all these boxes are created in the network by the watchers. The watchers use their permits to create new commitments, and need to track created commitments and triggers to continue their procedures. On the other side, guards need to track event trigger boxes to verify the related user payment and start an agreement on the exchange transaction.

## Related Projects

This module is used within the [Scanner](https://github.com/rosen-bridge/scanner) project. As stated above, this module is used in the [Watcher](https://github.com/rosen-bridge/watcher) service to drive the related boxes. It also used in the [Guard](https://github.com/rosen-bridge/watcher) to track the created event triggers.

## How to Use the Watcher Data Extractor

### Install

This project is written in node-js using Esnext module and typeorm database. Extractors are not standalone projects and should be used as scanner modules. You can easily install it using npm with the command:

```shell
npm install @rosen-bridge/watcher-data-extractor
```

Alternatively, you can build and use it manually by cloning the project and running:

```shell
npm install
npm run build
```

### Usage

In the first step, you need to create a scanner instance; follow the steps [here](https://github.com/rosen-bridge/scanner) to create a running instance of the scanner. Then, you need to instantiate your desired extractors and register them to your ergo scanner:

```javascript
const commitmentExtractor = new CommitmentExtractor(
    <extractor_name>,
    <Array<commitment_address>>,
    <rwt_id>,
    dataSource
)
const permitExtractor = new PermitExtractor(
    <extractor_name>,
    dataSource,
    <permit_address>,
    <rwt_id>
)
const eventTriggerExtractor = new EventTriggerExtractor(
    <extractor_name>,
    dataSource,
    <event_trigger_address>,
    <rwt_id>
)
ergoScanner.registerExtractor(commitmentExtractor)
ergoScanner.registerExtractor(permitExtractor)
ergoScanner.registerExtractor(eventTriggerExtractor)
```

## Contributing

TBD

## License

TBD
npm package: @rosen-bridge/wid-check
Description: Rosen bridge wid health-check parameter
Author: Rosen Team
Latest version: 3.0.1

# @rosen-bridge/wid-check

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen bridge wid health-check parameter

## Installation

npm:

```sh
npm i @rosen-bridge/wid-check
```

yarn:

```sh
yarn add @rosen-bridge/wid-check
```
npm package: @rosen-bridge/winston-logger
Description: Rosen Bridge Winston logger, used inside Rosen services
Author: Rosen Team
Latest version: 3.0.0

# @rosen-bridge/winston-logger

## Table of contents

- [Introduction](#introduction)
- [Installation](#installation)

## Introduction

Rosen Bridge Winston logger, used inside Rosen services

## Installation

npm:

```sh
npm i @rosen-bridge/winston-logger
```

yarn:

```sh
yarn add @rosen-bridge/winston-logger
```