open-index/open-npm huggingface dataset:
npm package: @network-goods/hypercerts-sdk
Description: SDK for hypercerts protocol
Author: Network Goods
Latest version: 0.0.20
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Hypercert SDK

## Set up

### Configuration

1. Copy `.env.template` to `.env`
2. Create an API key on [NFT.Storage](https://nft.storage/) by going [here](https://nft.storage/manage). Add this to your config.


### Dependencies

```bash
yarn install
```

### Build

```bash
yarn build
```

`yarn lerna run bootstrap`

`yarn lerna run tsc`

## Interface

[API documentation](/docs/API.md)
[Graph playground](https://thegraph.com/hosted-service/subgraph/bitbeckers/hypercerts-dev)

## Packages

### Contracts

Typed instances of Hypercert protocol

### Metadata

Metadata validator/generator/uploader

### Graph Client

GraphQL client for Hypercerts with predefined queries and client

### Types

- Contracts
- Graph entities
- Hypercert domain


-- to be rewritten:
* Example metadata schema's
* Yup validation


Wrapper for [Graph-client](https://github.com/graphprotocol/graph-client)
npm package: @network-international/react-native-ngenius
Description: Network Internation Payment SDK for React-Native
Author: Johnny Peter
Latest version: 3.0.1

# react-native-ni-sdk

![Banner](assets/banner.jpg)

## Requirements
- Reat-native `v0.60+`
- iOS version `11+`
- Android minSDK version `19`

## Getting started
```bash
npm i @network-international/react-native-ngenius
```

**Note:** If your project is using iOS deployment target 10, you need to increase it to 11.

In order to increase change the versions in the following files
- Change the iOS deployment version in `your-project/ios/Podfile` as follows `platform :ios, '11.0'`  
- Open the `.xcworkspacefile` inside the following directory `your-project/ios/yourproject.xcworkspace` and change the deployment target to 11.0.

## Basic usage example
```javascript
import {
  initiateCardPayment,
  initiateSamsungPay,
  initiateApplePay,
  initiateGooglePay,
} from '@network-international/react-native-ngenius';

// order is the order response received from NGenius create order API
const makeCardPayment = async () => {
    try {
      const resp = await initiateCardPayment(order);
    } catch (err) {
      console.log({ err });
    }
};

// order is the order response received from NGenius create order API
// merchantName is the name of merchant's establishment
// serviceId is the serviceId that is generated in the Samsung Pay developer portal
const makeSamsungPayPayment = async () => {
    try {
      const resp = await initiateSamsungPay(order, merchantName, serviceId);
    } catch (err) {
      console.log({ err });
    }
};

// order is the order response received from NGenius create order API
// mid is the merchant ID that is generated in the Apple developer portal
// countryCode is the country code of the transaction country Eg: AE for UAE
const makeApplePayPayment = async () => {
    try {
      const resp = await initiateApplePay(order, { // order is the order response after creating an order
        merchantIdentifier: '', // Merchant ID created in Apple's portal
        countryCode: '', // Country code of the order Eg, AE
        merchantName: '', // name of the merchant to be shown in Apple Pay button
      });
    } catch (err) {
      console.log({ err });
    }
};

const makeGooglePayPayment = async () => {
    try {
      const resp = await initiateGooglePay(order, {
        merchantName: '', // name of the merchant
        gateway: '', // gateway name
        gatewayMerchantId: '', // gateway merchant ID
        environment: 'TEST', // 'TEST' or 'PRODUCTION'
      });
    } catch (err) {
      console.log({ err });
    }
};
```

## Quick Links

* [Basic Usage](https://github.com/network-international/react-native-ngenius/wiki/Basic-Usage)
* [Samsung Pay](https://github.com/network-international/react-native-ngenius/wiki/Samsung-Pay)
* [Samsung Pay FAQ & Troubleshooting](https://github.com/network-international/react-native-ngenius/wiki/Samsung-Pay#faq--troubleshooting)
* [Apple Pay](https://github.com/network-international/react-native-ngenius/wiki/Apple-Pay)
* [Google Pay](https://github.com/network-international/react-native-ngenius/wiki/Google-Pay)
npm package: @network-toolkit/env
Description: network-toolkit-env
Author: jiangweiye
Latest version: 0.0.2

# @network-toolkit/env

环境变量

## 安装

### with pnpm

```sh
pnpm add @network-toolkit/env
```

### with yarn

```sh
yarn add @network-toolkit/env
```

### with npm

```sh
npm install @network-toolkit/env
```
npm package: @network-toolkit/request
Description: network-toolkit-request
Author: jiangweiye
Latest version: 0.0.1

# @@network-toolkit/ajax

## 接口

**Response**

```typescript
/**
 * @description 接口响应体
 * @interface Response
 * @template D
 * @property {string} result_code 响应码
 * @property {D} data 响应数据
 * @property {string} result_msg 响应信息
 * @property {number} [recordsTotal] 总条数
 * @example
 * {
 *    "result_code": "0",
 *    "data": {
 *      "id": 1,
 *      "name": "张三"
 *     },
 *    "result_msg": "请求成功"
 * }
 */
interface Response<D = any> {
    result_code: string;
    data: D;
    result_msg: string;
    recordsTotal?: number;
}
```

**AXIOS_DEFAULT_CONFIG**

```typescript
/**
 * @description 默认配置
 * @type {AxiosRequestConfig}
 * @property {number} timeout 超时时间
 * @property {string} baseURL 基础路径
 * @property {string} responseType 响应数据类型
 */
declare const AXIOS_DEFAULT_CONFIG: AxiosRequestConfig;
```

**IPostConfig**

```typescript
/**
 * @description post默认请求配置类型
 */
type IPostConfig = Pick<AxiosRequestConfig, 'data' | 'params' | 'headers'>;
```

**DEFAULT_POST_CONFIG**

```typescript
/**
 * @description post默认请求参数
 */
declare const DEFAULT_POST_CONFIG: IPostConfig;
```

### 函数

**$post**

```typescript
/**
 * @description post请求
 * @param url 请求地址
 * @param config 请求配置
 * @returns {Promise<R>}
 * @example
 * $post('/xx/xx', { data: { a: 1 }, params: { b: 2 }, headers: { c: 1 } }).then(res => {
 *     console.log(res.data, `res.data`);
 *     console.log(res.result_code, `res.result_code`);
 *     console.log(res.result_msg, `res.result_msg`);
 * });
 */
declare const $post: <R = Response<any>>(url: string, config?: IPostConfig) => Promise<R>;
```

**$postForm**

```typescript
/**
 * @description post请求
 * @param url 请求地址
 * @param config 请求配置
 * @returns {Promise<R>}
 * @example
 * $postForm('/xx/xx', { data: { a: 1 }, params: { b: 2 }, headers: { c: 1 } }).then(res => {
 *     console.log(res.data, `res.data`);
 *     console.log(res.result_code, `res.result_code`);
 *     console.log(res.result_msg, `res.result_msg`);
 * });
 */
declare const $postForm: <R = Response<any>>(url: string, config?: IPostConfig) => Promise<R>;
```

**$get**

```typescript
/**
 * @description get请求
 * @param url 请求地址
 * @param config 请求配置
 * @returns {Promise<R>}
 * @example
 * $get('/xx/xx', { data: { a: 1 }, params: { b: 2 }, headers: { c: 1 } }).then(res => {
 *     console.log(res.data, `res.data`);
 *     console.log(res.result_code, `res.result_code`);
 *     console.log(res.result_msg, `res.result_msg`);
 * });
 */
declare const $get: <R = Response<any>>(url: string, config?: IPostConfig) => Promise<R>;
```

**$download**

```typescript
/**
 * @description 下载
 * @param url 请求地址
 * @param config 请求配置
 * @returns {Promise<R>}
 * @example
 * $download('/xx/xx', { params: { b: 2 } }).then(res => {
 *     console.log(res.data, `res.data`);
 *     console.log(res.result_code, `res.result_code`);
 *     console.log(res.result_msg, `res.result_msg`);
 * });
 */
declare const $download: (url: string, config?: Pick<IPostConfig, 'params'>) => void;
```
npm package: @network-toolkit/shared
Description: network-toolkit-shared
Author: jiangweiye
Latest version: 0.0.1

# @network-toolkit/shared

工具包

## 安装

### with pnpm

```sh
pnpm add @network-toolkit/shared
```

### with yarn

```sh
yarn add @network-toolkit/shared
```

### with npm

```sh
npm install @network-toolkit/shared
```

## apis

### **getQueryString**

#### 获取 url 中的参数

| 字段名 | 类型          | 描述           | 必传 |
| ------ | ------------- | -------------- | ---- |
| query  | string        | 要获取的参数名 | 是   |
| href   | string \|null | 地址           | 否   |

#### 类型

```typescript
declare const getQueryString: (query: string, href?: string) => string | null;
```

#### 示例

```typescript
import { getQueryString } from '@network-toolkit/shared';
const url = 'http://example.com/?test=123&foo=bar';
const query = getQueryString('test');
console.log(query);
// 123
```

### debounce

#### **防抖**

| 字段名    | 类型                    | 描述           | 必传 |
| --------- | ----------------------- | -------------- | ---- |
| func      | (...args: any[]) => any | 需要防抖的函数 | 是   |
| duration  | number                  | 毫秒           | 否   |
| immediate | boolean                 | 是否立即执行   | 否   |

#### 类型

```typescript
declare const debounce: <F extends (...args: any[]) => any>(
    func: F,
    duration?: number,
    immediate?: boolean
) => (...args: Parameters<F>) => ReturnType<F>;
```

#### 示例

```typescript
import { debounce } from '@network-toolkit/shared';
const fn = debounce(() => {
    console.log('debounce');
}, 300);
fn();
```

### throttle

#### **节流**

| 字段名   | 类型                    | 描述     | 必传 |
| -------- | ----------------------- | -------- | ---- |
| func     | (...args: any[]) => any | 节流函数 | 是   |
| duration | number                  | 毫秒     | 否   |

#### 类型

```typescript
declare const throttle: <F extends (...args: any[]) => any>(func: F, duration?: number) => (...args: Parameters<F>) => ReturnType<F>;
```

#### 示例

```typescript
import { throttle } from '@network-toolkit/shared';
const fn = throttle(() => {
    console.log('throttle');
}, 1000);
fn();
```

---

### deepCopy

#### **深拷贝**

| 字段名 | 类型                                        | 描述         | 必传 |
| ------ | ------------------------------------------- | ------------ | ---- |
| data   | Array<any> \| Record<string \| symbol, any> | 要拷贝的数据 | 是   |

#### 类型

```typescript
declare const deepCopy: <T extends Array<T> | Record<string | symbol, any>>(data: T) => T;
```

#### 示例

```typescript
import { deepCopy } from '@network-toolkit/shared';
const obj = { a: 1, b: 2 };
const copyObj = deepCopy(obj);
console.log(copyObj);
```
npm package: @network-utils/dhcp
Description: NodeJS implementation of DHCP socket connection
Latest version: 1.0.10

# DHCP

[![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/mfucci/dhcp/master/LICENSE.md) 
[![CircleCI](https://circleci.com/gh/mfucci/dhcp.svg?style=svg)](https://circleci.com/gh/mfucci/dhcp)
[![Coverage Status](https://coveralls.io/repos/github/mfucci/dhcp/badge.svg?branch=master)](https://coveralls.io/github/mfucci/dhcp?branch=master)
[![npm version](https://badge.fury.io/js/@network-utils%2Fdhcp.svg)](https://badge.fury.io/js/@network-utils%2Fdhcp)

[![NPM](https://nodei.co/npm/@network-utils/dhcp.png?compact=true)](https://nodei.co/npm/@network-utils/dhcp?compact=true)

NodeJS implementation of DHCP socket connection

## Install

```
npm install @network-utils/dhcp
```

## Declarations

Module has got TypeScript declarations. It can be helpful to understand the module API

[See declarations](index.d.ts)

## Examples

### DHCP monitor

```javascript
"use strict";
let { BOOTMessageType, Server } = require("@network-utils/dhcp");

let s = new Server("192.168.1.1");

s.on("listening", () => {
    console.log("Server start", s.address);
});

s.on("dhcp", e => {
    console.log(e.packet.toString());
});

s.bind();
```

### DHCP server

```javascript
"use strict";
let { BOOTMessageType, Server } = require("@network-utils/dhcp");

let s = new Server({
    serverId: "192.168.1.1",
    gateways: ["192.168.1.1"],
    domainServer: ["192.168.1.1"],
});

s.on("listening", () => {
    console.log("Server start", s.address);
});

let ips = {};

s.on("discover", e => {
    console.log("DISCOVER");

    let pkt = e.packet;

    // Get IP by MAC
    let ip = "0.0.0.0";
    if (pkt.op === BOOTMessageType.request) {
        if (!(pkt.chaddr in ips))
            ip = ips[pkt.chaddr] = `192.168.1.${Object.keys(ips).length + 2}`;
        else
            ip = ips[pkt.chaddr];
    }

    let offer = s.createOffer(pkt);

    offer.yiaddr = ip;

    s.send(offer);
});
s.on("request", e => {
    console.log("REQUEST");
    let ack = s.createAck(e.packet);

    ack.yiaddr = ips[e.packet.chaddr];

    s.send(ack);
});
s.on("release", e => {
    console.log("RELEASE");
    delete ips[e.packet.chaddr];
});

s.bind();
```

## RFC

- [Dynamic Host Configuration Protocol](https://tools.ietf.org/html/rfc2131)
- [DHCP Options and BOOTP Vendor Extensions](https://tools.ietf.org/html/rfc2132)

## RELATED

- [dhcpjs](https://github.com/apaprocki/node-dhcpjs)
- [node-dhcpd](https://github.com/glaszig/node-dhcpd)
- [forge](https://github.com/konobi/forge/blob/master/lib/dhcpd.js)
npm package: @network-utils/tcp-scanner
Description: A dead simple promise-based TCP scanner, written in Typescript.
Author: Justin Taddei
Latest version: 1.0.2

# TCP-Scanner

![](https://img.shields.io/travis/justintaddei/tcp-scanner.svg?style=flat)
![](https://img.shields.io/github/issues-raw/justintaddei/tcp-scanner.svg?style=flat)
![](https://img.shields.io/npm/v/@network-utils/tcp-scanner.svg?style=flat)
![](https://img.shields.io/npm/dt/@network-utils/tcp-scanner.svg?style=flat)
![](https://img.shields.io/npm/l/@network-utils/tcp-scanner.svg?style=flat)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier)
![](https://img.shields.io/github/languages/top/justintaddei/tcp-scanner.svg?colorB=blue&style=flat)
![](https://img.shields.io/badge/status-awesome-red.svg?style=flat)

A dead simple promise-based TCP scanner, written in Typescript.

## Installation

```bash
$ npm install @network-utils/tcp-scanner --save
```

## Usage

### `scan(port: number, range?: string, timeout?: number): Promise<string[]>`

Scans the network for hosts with `port` open.

`port` The port to connect to.  
`range` A CIDR range or `"arp"` to limit the scan to the system's arp table  
`timeout` The timeout for each TCP connection. Defaults to `200ms`

**Throws** an `invalid CIDR subnet` error if `range` is not a CIDR range or the string `"arp"`  
**Throws** a `"Negative port"` error if `port < 1`.

---

## To-Do
- Add tests

## License

MIT
npm package: @network-utils/vendor-lookup
Description: Returns the IEEE registered vendor name from the MAC address, using an up-to-date database (with a script to update it automatically).
Author: Marco Fucci di Napoli
Latest version: 1.0.12

# vendor-lookup

Simple library with no dependencies to lookup the manufactuers from a network MAC address using an up-to-date database imported directly from IEEE registeries.

## Installation

```bash
$ npm install @network-utils/vendor-lookup
```

## Update the vendor database

```bash
$ npm run update
```

## Usage

### Example

```typescript
import {toVendor} from '@network-utils/vendor-lookup'

const vendor = toVendor('04:a1:51:1b:12:92') // Returns 'NETGEAR'
```

### `toVendor(mac: string): string`

Returns the IEEE registered vendor for the prefix of this MAC address
or '<random MAC>' if the MAC address is a random MAC (often used by mobile devices for privacy)
or '<private>' if this prefix is associated with a vendor which choosed to keep their records private
or '<unknown>' of this prefix is not in IEEE database

### `isRandomMac(mac: string): boolean`

Returns true if this MAC address is random
npm package: @network/localtunnel
Description: expose localhost to the world
Author: KhoaZero123
Latest version: 1.0.0

# httptunnel

[![Build Status](https://travis-ci.org/httptunnel/httptunnel.svg?branch=master)](https://travis-ci.org/httptunnel/httptunnel)

httptunnel exposes your localhost to the world for easy testing and sharing! No need to mess with DNS or deploy just to have others test out your changes.

Great for working with browser testing tools like browserling or external api callback services like twilio which require a public url for callbacks.

## installation ##

```
npm install -g httptunnel
```

This will install the httptunnel module globally and add the 'lt' client cli tool to your PATH.

## use ##

Assuming your local server is running on port 8000, just use the ```lt``` command to start the tunnel.

```
lt --port 8000
```

Thats it! It will connect to the tunnel server, setup the tunnel, and tell you what url to use for your testing. This url will remain active for the duration of your session; so feel free to share it with others for happy fun time!

You can restart your local server all you want, ```lt``` is smart enough to detect this and reconnect once it is back.

### arguments

Below are some common arguments. See `lt --help` for additional arguments

* `--subdomain` request a named subdomain on the httptunnel server (default is random characters)
* `--local-host` proxy to a hostname other than localhost

You may also specify arguments via env variables.  E.x.

```
PORT=3000 lt
```

## API ##

The httptunnel client is also usable through an API (for test integration, automation, etc)

### httptunnel(port [,opts], fn)

Creates a new httptunnel to the specified local `port`. `fn` will be called once you have been assigned a public httptunnel url. `opts` can be used to request a specific `subdomain`.

```javascript
var httptunnel = require('httptunnel');

var tunnel = httptunnel(port, function(err, tunnel) {
    if (err) ...

    // the assigned public url for your tunnel
    // i.e. https://abcdefgjhij.httptunnel.tech
    tunnel.url;
});

tunnel.on('close', function() {
    // tunnels are closed
});
```

### opts

* `subdomain` A *string* value requesting a specific subdomain on the proxy server. **Note** You may not actually receive this name depending on availability.
* `local_host` Proxy to this hostname instead of `localhost`. This will also cause the `Host` header to be re-written to this value in proxied requests.

### Tunnel

The `tunnel` instance returned to your callback emits the following events

|event|args|description|
|----|----|----|
|request|info|fires when a request is processed by the tunnel, contains _method_ and _path_ fields|
|error|err|fires when an error happens on the tunnel|
|close||fires when the tunnel has closed|

The `tunnel` instance has the following methods

|method|args|description|
|----|----|----|
|close||close the tunnel|

## License ##
MIT
npm package: @networkcamp/sdk
Description: Official TypeScript SDK for the network.camp public API.
Author: network.camp
Latest version: 0.1.5

# @networkcamp/sdk

Official TypeScript SDK for the network.camp public API.

## Installation

```sh
npm install @networkcamp/sdk
```

## Usage

```ts
import { NetworkCamp } from '@networkcamp/sdk';

const api = new NetworkCamp('nc_<keyId>_<secret>');

// List all monitors
const { data: monitors } = await api.listMonitors();
console.log(monitors);

// Get response time series for a monitor
const { data: series } = await api.responseSeries('mon_abc123');
console.log(series);

// List incidents
const { data: incidents } = await api.listIncidents();
console.log(incidents);

// Get daily latency aggregates for a monitor
const { data: latency } = await api.latencyDaily('mon_abc123');
console.log(latency);
```

## API Endpoints

All endpoints require authentication with your API key in the `Authorization` header:

```
Authorization: Bearer nc_<keyId>_<secret>
```

### listMonitors()
**GET** `/v1/monitors`

Returns all monitors for your domains.

### responseSeries(monitorId: string, limit = 720)
**GET** `/v1/monitors/{monitorId}/response-series?limit={limit}`

Returns a time series of recent checks for a monitor.

### listIncidents()
**GET** `/v1/incidents`

Returns all incidents for your domains.

### latencyDaily(monitorId: string)
**GET** `/v1/monitors/{monitorId}/latency-daily`

Returns daily latency aggregates for a monitor.

## Error Handling & Redundancy

All methods throw on network or API errors, with descriptive messages. Requests are retried up to 3 times with exponential backoff for transient errors.

## Types

All responses are fully typed. See `src/index.ts` for type definitions: `Monitor`, `ResponsePoint`, `Incident`, `LatencyDaily`.

## Links & Community

- GitHub: https://github.com/networkcamp
- Twitter/X: https://x.com/networkdotcamp
- Instagram: https://www.instagram.com/networkdotcamp/

## License
MIT