open-index/open-npm huggingface dataset:
npm package: @nikampratik9096/auto-auth
Description: A unified authentication SDK combining bcrypt, JWT, and Role-Based Access Control (RBAC).
Author: Pratik Rajendra Nikam
Latest version: 2.0.1

# Authentication SDK

## Overview

This SDK provides a unified solution for authentication in Node.js applications, combining password hashing, JWT generation, and Role-Based Access Control (RBAC). It is designed to be easy to integrate into your existing projects, offering middleware for Express and Fastify frameworks.

## Features

- **Password Hashing**: Securely hash and verify passwords using bcrypt.
- **JWT Authentication**: Generate and verify JSON Web Tokens for user sessions.
- **Role-Based Access Control**: Define roles and permissions to control access to resources.
- **TypeScript Support**: Fully typed SDK for better development experience.

## Installation

To install the SDK, run the following command:

```bash
npm install your-auth-sdk
```

## Usage

### Initialization

To initialize the authentication system, use the `initAuth` function:

```typescript
import { initAuth } from 'your-auth-sdk';

const auth = initAuth({
  jwtSecret: 'your-secret',
  saltRounds: 10,
  rolesConfig: {
    admin: {
      can: ['*']
    },
    user: {
      can: ['read:resource']
    }
  }
});
```

### Middleware

You can use the provided middleware for protecting your routes:

```typescript
import express from 'express';
import { authMiddleware, roleMiddleware } from 'your-auth-sdk/middleware';

const app = express();

app.use(authMiddleware);

app.get('/protected', (req, res) => {
  res.send('This is a protected route');
});

app.get('/admin', roleMiddleware('admin'), (req, res) => {
  res.send('This is an admin route');
});
```

## API Reference

### `initAuth(config: AuthConfig)`

Initializes the authentication system with the provided configuration.

### Middleware

- **`authMiddleware`**: Middleware to verify JWT tokens.
- **`roleMiddleware(requiredRoles: string | string[])`**: Middleware to check if the user has the required role.

## License

This project is licensed under the MIT License. See the LICENSE file for more details.

## Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
npm package: @nikandlv/fox
Description: A Simple, Easy and fast state manager
Latest version: 1.0.0

### Fox state manager

#### Logic

keep everything simple, share functions and data you want from a component either `set` or `get` and keep track of their update on other components!

every item has a key that you can access directly from `fox` object or get it from the manager

`fox` object is the big object that contains everything we publish

`manager` is the functions that we use to interact with `fox`

#### Usage

import it

`import {fox,manager} from '@nikandlv/fox'`

use it!

you can publish what ever you want

`manager.publish(key,value)`

`manager.publish("test",()=> { console.log("test") })`

`manager.publish("test1","im just a string")`

and you can unPublish them when you have to (when the component is not mounted anymore)

`manager.unpublish(key)`

`manager.unpublish("test")`

`manager.unpublish("test2")`

then you can get them where you want like so

`manager.get(key,default_value)`

`manager.get("test",null)`

`manager.get("test2","test2 not found!")`

the second parameter is the default value if the key does not exist

or if you are sure you can access it directly at

`fox.key`

`fox.test`

`fox.test2`

the key can also be as you want. for example

`manager.publish("foo.bar","im just a string")`

will be

`fox.foo.bar`

#### Events

Listener when key is published 

`manager.onPublish(key,event_function)`

runs once and asap when the key is available

Listener when key is unpublished 

`manager.onUnpublish(key,event_function)`

runs once and asap when the key is available

Listener when key is updated 

`manager.onUpdate(key,event_function)`

runs every time and asap when the key is updated
npm package: @nikaple/mapped-types
Description: Create data classes easily
Author: nikaple
Latest version: 1.0.3

## Description

This is a fork of `mapped-types` from [Nest.js](https://github.com/nestjs/nest), but generalized to be used in other projects.

## Installation

```bash
$ npm i --save @nikaple/mapped-types
```

## Quick Start

As you build out features, it's often useful to construct variants on a base entity type. A good example of such a variant is a **Data Transfer Object** (DTO). A Data Transfer Object is an object that is used to encapsulate data, and send it from one part of your application to another. DTO’s help us define the input and output interfaces of our system.

Let's imagine a real-world example, where we typically need to build both a **create** and **update** variations for the same entity type.

The create variant may require all fields, while the update variant may make all fields **optional**. Not to mention, both these types can also be variants of an entity type (to some extent).

That's a lot of redundant code!

Thus, this project now provides several utility functions that perform type transformations to help us avoid doing this, and make life a little bit easier.

Available mapped types:

- `PartialType` - returns a type (class) with all the properties of the input type set to optional (requirement: at least 1 validation decorator applied to each property)
- `PickType` - constructs a new type (class) by picking a set of properties from an input type
- `OmitType` - constructs a type by picking all properties from an input type and then removing a particular set of keys
- `IntersectionType` - combines two types into one new type (class)

Read more in [this article](https://trilon.io/blog/introducing-mapped-types-for-nestjs).
npm package: @nikaru-dev/provider-phantom
Description: Phantom integration for hub. [Homepage](https://phantom.com/) | [Docs](https://docs.phantom.com/)
Latest version: 0.28.0

# Phantom Provider
Phantom integration for hub.  
[Homepage](https://phantom.com/) | [Docs](https://docs.phantom.com/)

More about implementation status can be found [here](../readme.md).

## Implementation notes/limitation

### Group

#### ⚠️ UTXO
Only supports Bitcoin.

#### ⚠️ EVM
Only supports Ethereum, Base, and Polygon.

### Feature

#### ⚠️ Auto Connect
On Sui, Phantom uses Solana's auto-connect mechanism.  
This means if Solana is not connected simultaneously, the auto-connect feature on Sui will not work properly.

---

More wallet information can be found in [readme.md](../readme.md).
npm package: @nikaru-dev/provider-rabby
Description: Rabby Wallet integration for hub. [Homepage](https://rabby.io/) | [Docs](https://rabby.io/docs/integrating-rabby-wallet)
Latest version: 0.16.0

# Rabby
Rabby Wallet integration for hub.  
[Homepage](https://rabby.io/) | [Docs](https://rabby.io/docs/integrating-rabby-wallet)

More about implementation status can be found [here](../readme.md).
npm package: @nikaru-dev/provider-slush
Description: Slush integration for hub. [Homepage](https://slush.app/) | [Docs](https://docs.sui.io/standards/wallet-standard)
Latest version: 0.5.0

# Slush
Slush integration for hub.  
[Homepage](https://slush.app/) | [Docs](https://docs.sui.io/standards/wallet-standard)

More about implementation status can be found [here](../readme.md).

## Implementation notes/limitation

### Group

#### ✅ Sui
Only supports the Sui blockchain.

### Feature

#### ❌ Switch Account
The wallet does not emit an event when the active account changes, making it difficult to detect account switches programmatically.

Regardless of the selected account in the wallet UI, Slush always connects to the first account.

#### ❌ Cross Browser
The wallet is only available on Chrome.

---

More wallet information can be found in [wallets readme](../readme.md).
npm package: @nikaru-dev/provider-trustwallet
Description: Trust Wallet integration for hub. [Homepage](https://trustwallet.com/) | [Docs](https://developer.trustwallet.com/developer/develop-for-trust/browser-extension)
Latest version: 0.28.0

# Trust Wallet
Trust Wallet integration for hub.  
[Homepage](https://trustwallet.com/) | [Docs](https://developer.trustwallet.com/developer/develop-for-trust/browser-extension)  


## Implementation notes/limitations

### Group

#### ⚠️ EVM & Solana
Trust Wallet supports both EVM and Solana, but **simultaneous connections across namespaces are unreliable**.  

### Feature

#### ⚠️ Switch Account
When connected to a **single namespace**:
- Switching **from a private key wallet to a full wallet** triggers a **switch account event**.
- Switching **from a full wallet to a private key wallet** emits **no event**.

When connected to **both namespaces simultaneously**:
- Only the **first connected namespace** (e.g., EVM or Solana) properly receives events.
- The **second namespace** does **not** receive `accountsChanged` events.

#### ⚠️ Auto Connect
- **Auto connect is not supported**:
  - On **Solana**, there is no silent reconnection mechanism.
  - On **EVM**, the wallet always opens a popup when the dApp is not already connected.

---

More wallet information can be found in [readme.md](../readme.md).
npm package: @nikaru-dev/provider-unisat
Description: UniSat integration for hub. [Homepage](https://unisat.io/) | [Docs](https://docs.unisat.io/dev/open-api-documentation/unisat-wallet)
Latest version: 0.5.0

# UniSat Provider
UniSat integration for hub.  
[Homepage](https://unisat.io/) | [Docs](https://docs.unisat.io/dev/open-api-documentation/unisat-wallet)

More about implementation status can be found [here](../readme.md).

## Implementation notes/limitation

### Group

#### ⚠️ UTXO
Only supports Bitcoin.

### Feature

#### ❌ Auto Connect
UniSat Wallet doesn’t support auto-connect

---

More wallet information can be found in [readme.md](../readme.md).
npm package: @nikaru-dev/provider-walletconnect-2
Description: ## Known issues
Latest version: 0.21.0

# @nikaru-dev/provider-walletconnect2


## Known issues

- Using Private key to import wallets other than `Ethereum` will be problematic. Because it imports only a single blockchain and we are by default asking for `Ethereum`.  
- Signing a transaction on Metamask goes through an internal error.
- We couldn't update exist session during a bug in `@walletconnect/utils`, so we are creating new session for accessing to new chains.