open-index/open-npm huggingface dataset:
npm package: @huma-shan/types
Description: Types for Request Network packages.
Latest version: 0.40.0

# @huma-shan/types

`@huma-shan/types` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is the collection of typescript types shared across @requestnetwork packages.

## Installation

```bash
npm install @huma-shan/types --save-dev
```

## Usage

```javascript
import { IdentityTypes, SignatureTypes } from '@huma-shan/types';

const signatureMethod = SignatureTypes.REQUEST_SIGNATURE_METHOD.ECDSA;
const identityType = IdentityTypes.REQUEST_IDENTITY_TYPE.ETHEREUM_ADDRESS;
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[Read the contributing guide](/CONTRIBUTING.md)

## License

[MIT](/LICENSE)
npm package: @huma-shan/utils
Description: General tools for Request Network packages.
Latest version: 0.40.0

# @huma-shan/utils

`@huma-shan/utils` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is a collection of tools shared between the @requestnetwork packages.

## Installation

```bash
npm install @huma-shan/utils
```

## Usage

```javascript
import { normalizeKeccak256Hash } from '@huma-shan/utils';

const hash = normalizeKeccak256Hash({ exampleData: true });
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[Read the contributing guide](/CONTRIBUTING.md)

## License

[MIT](/LICENSE)
npm package: @huma-shan/web3-signature
Description: Signature provider using web3 ethereum library.
Latest version: 0.5.11

# @huma-shan/web3-signature

Web3 Signature Provider.

`@huma-shan/web3-signature` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).

Implementation of the signature provider from the web3 tools.
The signature provider is used to make signature in the Request Network Protocol (e.g.: see [Request Logic](/packages/request-logic)).
This provider allows users to use Metamask to sign data.

It uses the Request Network Protocol concepts of `Identity` and `Signature` described in the [request logic specification](/packages/request-logic/specs/request-logic-specification-v2.0.0.md).

## Installation

```bash
npm install @huma-shan/web3-signature
```

## Usage

```javascript
import {
  IdentityTypes,
  SignatureTypes
} from '@huma-shan/types'

import Web3SignatureProvider from '@huma-shan/web3-signature'

// Identity from the previous signature parameter
const identityExample: IdentityTypes.IIdentity = {
  type: IdentityTypes.TYPE.ETHEREUM_ADDRESS,
  value: '0x627306090abab3a6e1400e9345bc60c78a8bef57'
};

// Construct the provider with a
const signatureProvider = new Web3SignatureProvider(web3.currentProvider);

// can sign data with identity
const dataToSign = { ... };
const signedData = signatureProvider.sign(dataToSign, identityExample);
/*
{
  data: { ... },
  signature: {
    method: SignatureTypes.METHOD.ECDSA,
    value: '0x...'
  }
}
*/
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
[Read the contributing guide](/CONTRIBUTING.md)

## License

[MIT](/LICENSE)