open-index/open-npm huggingface dataset:
npm package: @requestnetwork/advanced-logic
Description: Main package for the Advanced Request Network logic layer.
Latest version: 0.57.0

# @requestnetwork/advanced-logic

`@requestnetwork/advanced-logic` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is the default implementation of the Advanced Logic layer. This layer hosts the extensions to the protocol, see Implemented Extensions for the list.

## Installation

```bash
npm install @requestnetwork/advanced-logic
```

## Specifications

Specifications of Advanced Logic can be found [here](/packages/advanced-logic/specs/advanced-logic-specs-0.1.0.md)

## Implemented Extensions

### Content Data

This extension allows linking content data to the request. The content data can be used to give extra information about the request. You can find examples of content data format [here](/packages/data-format).

Specifications of Content Data can be found [here](/packages/advanced-logic/specs/content-data-0.1.0.md)

### Declarative payments

This extension allows the payments and the refunds to be made in any currency.
The payments and refunds are documented by the payer and the payee of the request.

This extension do not ensure payment detection, only a consensus is made between the payer and the payee.

Specifications of Declarative payments can be found [here](/packages/advanced-logic/specs/payment-network-any-declarative-0.1.0.md)

### Address based bitcoin payments

This extension allows the payments and the refunds to be made on the Bitcoin blockchain.

Note: this extension can be used with the bitcoin mainnet and testnet.

Specifications of Address based bitcoin payments can be found [here](/packages/advanced-logic/specs/payment-network-btc-address-based-0.1.0.md)

## 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: @requestnetwork/currency
Description: Currency tools for Request Network packages.
Latest version: 0.31.0

# @requestnetwork/currency

`@requestnetwork/currency` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is a collection of tools for the currencies and chains shared between the @requestnetwork packages.

## Installation

```bash
npm install @requestnetwork/currency
```

## Usage

```javascript
import { RequestLogicTypes } from '@requestnetwork/types';
import { Currency, Token } from '@requestnetwork/currency';

const decimals = new Currency({
  type: RequestLogicTypes.CURRENCY.ETH,
  value: 'ETH',
}).getDecimals();

console.log(decimals); // 18

const ETHHash = new Currency({
  type: RequestLogicTypes.CURRENCY.ETH,
  value: 'ETH',
}).getHash();

console.log(ETHHash); // 0xF5AF88e117747e87fC5929F2ff87221B1447652E

// Get currencies from their symbol
const ETHCurrency: RequestLogicTypes.ICurrency = Currency.from('ETH');
const FAUCurrency: RequestLogicTypes.ICurrency = Currency.from('DAI');
// Get currencies from their address
const DAICurrency: RequestLogicTypes.ICurrency = Currency.from(
  '0x6B175474E89094C44Da98b954EedeAC495271d0F',
);

console.log(FAUCurrency.toString()); // FAU-rinkeby
console.log(DAICurrency.toString()); // DAI

// Get a token symbol from its address
const FAUToken = Token.from('0xFab46E002BbF0b4509813474841E0716E6730136');

console.log(FAUToken.symbol); // FAU
```

## 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)

### Adding a new chain

Supported chains are listed in `src/chains`:

- `src/chains/btc/data` for BTC type chains
- `src/chains/evm/data` for EVM type chains
- `src/chains/near/data` for NEAR type chains

The chain names are subjective, but they are unique and uniform across all Request Network packages.
They are formatted with the kebab-case naming convention.

In order to add a new chain, first create a file `[nameOfTheChain].ts` in the correct directory.
Its internal structure should conform with the corresponding type, respectively:

- `BtcChain`
- `EvmChain`
- `NearChain`

These types are described in the `index.ts` file of each chain subdirectory.
Please add the `testnet: true` property for staging chains.

## License

[MIT](/LICENSE)
npm package: @requestnetwork/data-format
Description: Data format for the Request Network protocol.
Latest version: 0.23.0

# @requestnetwork/data-format

`@requestnetwork/data-format` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is a JSON Schema library providing standard for the data of the Request Network protocol. It also provide a javascript entry point to validate a given JSON.

## Installation

```bash
npm install @requestnetwork/data-format
```

### Usage

```js
import * as dataFormat from '@requestnetwork/data-format';

let result = data - format.validate(A_JSON_OBJECT);

if (!result.valid) {
  // use the errors from result.errors
}
```

## Available JSON Schema

| Name                                                    | Last version | Last version | Description                 |
| ------------------------------------------------------- | ------------ | ------------ | --------------------------- |
| [Invoice](/packages/data-format/src/format/rnf_invoice) | rnf_invoice  | 0.0.3        | Format to create an invoice |

## 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: @requestnetwork/epk-cipher
Description: Cipher provider using ethereum private keys.
Latest version: 0.13.0

# @requestnetwork/epk-cipher

Ethereum Private Key Cipher Provider.

`@requestnetwork/epk-cipher` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).

Implementation of the cipher provider from the private keys.
The cipher provider is used to make encryption and decryption in the Request Network Protocol (e.g.: see [Transaction Manager](/packages/transaction-manager)).

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

## Installation

```bash
npm install @requestnetwork/epk-cipher
```

## Usage

```javascript
import { EncryptionTypes, IdentityTypes } from '@requestnetwork/types'

import EthereumPrivateKeyCipherProvider from '@requestnetwork/epk-cipher'

const cipherParametersExample: EncryptionTypes.ICipherParameters = {
  key: '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3',
  method: EncryptionTypes.METHOD.ECIES,
};

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

// Construct the provider with a
const cipherProvider = new EthereumPrivateKeyCipherProvider(cipherParametersExample);

// can list the identity usable
const listOfAvailableIdentity = cipherProvider.getAllRegisteredIdentities(); // [identityExample]

// can decrypt data with identity
const dataToDecrypt = "02....";
const decryptedData = await cipherProvider.decrypt(dataToDecrypt, identityExample); // "Decrypted data..."

// can add a new decryption parameters
cipherProvider.addDecryptionParameters({method: EncryptionTypes.METHOD.ECIES, key: ...});

// can remove a cipher parameters from its identity
cipherProvider.removeRegisteredIdentity({type: IdentityTypes.TYPE.ETHEREUM_ADDRESS, value: ...});

// can remove all cipher parameters
cipherProvider.clearAllRegisteredIdentities();
```

## 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: @requestnetwork/epk-decryption
Description: Decryption provider using ethereum private keys.
Latest version: 0.11.0

# @requestnetwork/epk-decryption

Ethereum Private Key Decryption Provider.

`@requestnetwork/epk-decryption` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).

Implementation of the decryption provider from the private keys.
The decryption provider is used to make decryption in the Request Network Protocol (e.g.: see [Transaction Manager](/packages/transaction-manager)).

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

## Installation

```bash
npm install @requestnetwork/epk-decryption
```

## Usage

```javascript
import { EncryptionTypes, IdentityTypes } from '@requestnetwork/types'

import EthereumPrivateKeyDecryptionProvider from '@requestnetwork/epk-decryption'

const decryptionParametersExample: EncryptionTypes.IDecryptionParameters = {
  key: '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3',
  method: EncryptionTypes.METHOD.ECIES,
};

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

// Construct the provider with a
const decryptionProvider = new EthereumPrivateKeyDecryptionProvider(decryptionParametersExample);

// can list the identity usable
const listOfAvailableIdentity = decryptionProvider.getAllRegisteredIdentities(); // [identityExample]

// can decrypt data with identity
const dataToDecrypt = "02....";
const decryptedData = await decryptionProvider.decrypt(dataToDecrypt, identityExample); // "Decrypted data..."

// can add a new decryption parameters
decryptionProvider.addDecryptionParameters({method: EncryptionTypes.METHOD.ECIES, key: ...});

// can remove a decryption parameters from its identity
decryptionProvider.removeRegisteredIdentity({type: IdentityTypes.TYPE.ETHEREUM_ADDRESS, value: ...});

// can remove all decryption parameters
decryptionProvider.clearAllRegisteredIdentities();
```

## 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: @requestnetwork/epk-signature
Description: Signature provider using ethereum private keys.
Latest version: 0.13.0

# @requestnetwork/epk-signature

Ethereum Private Key Signature Provider.

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

Implementation of the signature provider from the private keys.
The signature provider is used to make signature in the Request Network Protocol (e.g.: see [Request Logic](/packages/request-logic)).

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 @requestnetwork/epk-signature
```

## Usage

```javascript
import { IdentityTypes,  SignatureTypes } from '@requestnetwork/types'

import EthereumPrivateKeySignatureProvider from '@requestnetwork/epk-signature'

const signatureParametersExample: SignatureTypes.ISignatureParameters = {
  method: SignatureTypes.METHOD.ECDSA,
  privateKey: '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3',
};

// 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 EthereumPrivateKeySignatureProvider(signatureParametersExample);

// can list the identity usable
const listOfAvailableIdentity = signatureProvider.getAllRegisteredIdentities(); // [identityExample]

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

// can add a new signature parameters
signatureProvider.addSignatureParameters({method: ..., privateKey: ...});

// can remove a signature parameters from its identity
signatureProvider.removeRegisteredIdentity({type: ..., value: ...});

// can remove all signature parameters
signatureProvider.clearAllRegisteredIdentities();
```

## 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: @requestnetwork/multi-format
Description: Multi-format for Request Network packages.
Latest version: 0.31.0

# @requestnetwork/multi-format

`@requestnetwork/multi-format` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It allows to serialize and deserialize object in the Request Network protocol.

## Installation

```bash
npm install @requestnetwork/multi-format
```

## Usage

```javascript
import * as MultiFormat from '@requestnetwork/multi-format';
```

## 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: @requestnetwork/payment-processor
Description: Payment processing using ethers.
Latest version: 0.60.0

# @requestnetwork/payment-processor

`@requestnetwork/payment-processor` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It contains client-side payment methods for:

- ERC20 proxy contract
- ETH input data

### Test

To run the payment-processor tests we need a local running ganache with all our smart contracts deployed.
Do not define "NETWORK" variable in the smart-contracts .env file.
You can open two terminals and do:

```
# Terminal 1
cd ../smart-contracts/
yarn ganache

# Terminal 2
cd ../smart-contracts/
yarn deploy
cd ../payment-processor
yarn test
```

### Basic Usage

see [ERC20](/packages/usage-examples/src/pay-erc20-request.ts) and [ETH](/packages/usage-examples/src/pay-eth-request.ts) usage examples.
npm package: @requestnetwork/payment-widget
Description: A web component for accepting crypto payments using Request Network.
Latest version: 0.3.10

# Request Network Payment Widget Web Component

A web component for accepting crypto payments using Request Network.

## Introduction

The Payment Widget web component is a pre-built component that allows users to offer crypto payment options using Request Network without having to implement it themselves. It is built using Svelte but compiled to a Web Component, making it usuable in any web environment, regardless of the framework.

## Installation

To install the component, use npm:

```bash
npm install @requestnetwork/payment-widget
```

## Usage

### Usage in React

```tsx
import PaymentWidget from "@requestnetwork/payment-widget/react";

export default function PaymentPage() {
  return (
    <PaymentWidget
      sellerInfo={{
        logo: "https://example.com/logo.png",
        name: "Example Store",
      }}
      productInfo={{
        name: "Digital Art Collection",
        description: "A curated collection of digital artworks.",
        image: "https://example.com/product-image.jpg",
      }}
      amountInUSD={1.5}
      sellerAddress="0x1234567890123456789012345678901234567890"
      supportedCurrencies={["ETH_MAINNET", "USDC_MAINNET", "USDC_MATIC"]}
      persistRequest={true}
      onPaymentSuccess={(request) => {
        console.log(request);
      }}
      onError={(error) => {
        console.error(error);
      }}
    />
  );
}
```

## Additional Information

For more information, see the [Request Network documentation](https://docs.request.network/).
npm package: @requestnetwork/request-logic
Description: Main package for the Request Network logic layer.
Latest version: 0.47.0

# @requestnetwork/request-logic

`@requestnetwork/request-logic` is a typescript library part of the [Request Network protocol](https://github.com/RequestNetwork/requestNetwork).
It is the default implementation of the Request Logic layer. This layer is responsible for the business logic: properties and actions of requests.

Request logic creates actions, that are signed and sends them to the layer below, Transaction.

## Installation

```bash
npm install @requestnetwork/request-logic
```

## Usage

See [packages/usage-examples/request-logic.ts](`packages/usage-examples/src/request-logic.ts`).

## Features

- `createRequest` : create a request
- `createEncryptedRequest` : create an encrypted request
- `acceptRequest` : accept a request
- `cancelRequest` : cancel a request
- `increaseExpectedAmountRequest` : increase the amount of a request
- `reduceExpectedAmountRequest` : reduce the amount of a request
- `getFirstRequestFromTopic` : get the first request from the actions indexed by a topic (should be used with requestId)
- `getRequestsByTopic` : get all the requests for a topic
- `computeRequestId` : compute the ID of a request before actually creating it.

## Action topics

When an action is sent to the Transaction layer, strings named topics can be attached to it. These topics are used to index the action and, therefore, allow to retrieve it later in order to reconstruct the request.

Every action has at least its request id as a topic.

When creating a request, arbitrary topics can be attached to the `createRequest` action to index the request. For example, it can be the identity of the request creator in order to be able, later, to retrieve every request created by a user. Other actions than `createRequest` doesn't need additional topics since it contains the request id that can be linked to the corresponding `createRequest` action of the request.

## 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: @requestnetwork/secure-widget-sdk
Description: SDK for integrating Request Network Secure Widget
Author: Request Network
Latest version: 0.1.5

# @request-network/secure-widget-sdk

SDK for integrating Request Network Secure Widget into your application.

## Installation

```bash
pnpm add @request-network/secure-widget-sdk
# or
npm install @request-network/secure-widget-sdk
# or
yarn add @request-network/secure-widget-sdk
```

## Usage

### React Integration

```tsx
import { SecureWidget, useSecureWidgetContext } from '@request-network/secure-widget-sdk/react';

function App() {
  return (
    <SecureWidget>
      <YourComponent />
    </SecureWidget>
  );
}
```

### Core SDK (Framework Agnostic)

```typescript
import { setupEventListeners } from '@request-network/secure-widget-sdk/core';

// Use the core SDK without React by passing the iframe element to the appropriate functions
```

## Documentation

For full documentation, visit [Request Network Documentation](https://docs.request.network).

## License

MIT
npm package: @requestnetwork/shared
Description: [![npm version](https://badge.fury.io/js/%40requestnetwork%2Fshared.svg)](https://badge.fury.io/js/%40requestnetwork%2Fshared)
Latest version: 0.4.0

# Request Network Shared

[![npm version](https://badge.fury.io/js/%40requestnetwork%2Fshared.svg)](https://badge.fury.io/js/%40requestnetwork%2Fshared)

## Introduction

This package provides shared svelte components and utils used by other web components in this repo.

## Installation

To install the component, use npm:

```bash
npm install @requestnetwork/shared
```

## Additional Information

For more detailed information on using the Request Network and custom configurations, refer to the official [Request Network documentation](https://docs.request.network/).
npm package: @requestnetwork/types
Description: Types for Request Network packages.
Latest version: 0.57.0

# @requestnetwork/types

`@requestnetwork/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 @requestnetwork/types --save-dev
```

## Usage

```javascript
import { IdentityTypes, SignatureTypes } from '@requestnetwork/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: @requestnetwork/utils
Description: General tools for Request Network packages.
Latest version: 0.57.0

# @requestnetwork/utils

`@requestnetwork/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 @requestnetwork/utils
```

## Usage

```javascript
import { normalizeKeccak256Hash } from '@requestnetwork/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: @requestnetwork/web3-signature
Description: Signature provider using web3 ethereum library.
Latest version: 0.12.0

# @requestnetwork/web3-signature

Web3 Signature Provider.

`@requestnetwork/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 @requestnetwork/web3-signature
```

## Usage

```javascript
import {
  IdentityTypes,
  SignatureTypes
} from '@requestnetwork/types'

import Web3SignatureProvider from '@requestnetwork/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)
npm package: @require-x/python
Description: Require Python in JS
Author: Hackzzila
Latest version: 0.1.0

# python-js
[![Build status](https://ci.appveyor.com/api/projects/status/ijhto5tj0im9yybo?svg=true)](https://ci.appveyor.com/project/Hackzzila/python-js) [![Build Status](https://travis-ci.org/require-x/python-js.svg?branch=master)](https://travis-ci.org/require-x/python-js)

## Installation

### Install Python
Python 2 and 3 are required.

#### Debian/Ubuntu
```bash
sudo apt-get install python python3 python3-dev
```

#### Windows
Download the installer from [python.org](https://www.python.org/)

### Install require-py
```bash
npm install @require-x/python
```

## Usage

```js
const requirePy = require('@require-x/python');

const pyModule = requirePy('module'); // Loads the python module called "module"


```
npm package: @requiresun/countdown
Description: count down plugin
Author: Require Sun
Latest version: 1.0.3

# countdown

[![Build Status](https://travis-ci.org/RequireSun/countdown.svg?branch=master)](https://travis-ci.org/RequireSun/countdown)
[![Coverage Status](https://coveralls.io/repos/github/RequireSun/countdown/badge.svg?branch=master)](https://coveralls.io/github/RequireSun/countdown?branch=master)

A simple countdown addon.

# How to use

```javascript
new Countdown({
    endTime   : Date.now() + 10000,
    onTick    : remain => console.log(remain),
    onComplete: () => console.log('complete'),
});
```

_output_

```shell
9000
8000
7000
6000
5000
4000
3000
2000
1000
complete
```
npm package: @requrv/image-to-base64
Description: Convert any image file to Base64 data
Author: ReQurv
Latest version: 0.0.6


# Convert image file to Base64

The project simplifies the task of converting images loaded from a browser to the Base64 format.




## Authors

- [@ReQurv](https://github.com/ReQurv)
## Installation

Install with **yarn**:

```bash
  yarn add @requrv/image-to-base64
```

Install with **npm**:

```bash
  npm install @requrv/image-to-base64
```
## Usage/Examples

```typescript
import { convertImage } from '@requrv/image-to-base64'

async function convert(file: File) {
    return await convertImage(file)
}
```


## License

[MIT](https://choosealicense.com/licenses/mit/)