open-index/open-npm huggingface dataset:
npm package: @idecentralize/erclib
Description: ERC library for blockchain development
Author: Ian Decentralize
Latest version: 1.6.4

# erclib
[![Version npm](https://img.shields.io/npm/v/@idecentralize/erclib.svg?logo=npm)](https://www.npmjs.com/package/@idecentralize/erclib)
[![Node.js CI](https://github.com/idecentralize-finance/erclib/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/idecentralize-finance/erclib/actions/workflows/npm-publish.yml)
[![Socket Badge](https://socket.dev/api/badge/npm/package/@idecentralize/erclib)](https://socket.dev/npm/package/@idecentralize/erclib)

ERC library for blockchain Development


In development. More networks, asset's and features are coming...

## Install and import

```npm install @idecentralize/erclib```

> *address should be checksumed*

## Usage

### Retrieve the chain id from your current provider or configuration
```javascript
// using ethersV6
import {BrowserProvider} from "ethers";
const provider = new BrowserProvider(window.ethereum);
const chainId = (await PROVIDER.getNetwork()).chainId.toString() 
```

### import your library
   - ERC20
   - ERC721 
   - NETWORK
   - ROUTER
   - IPFS_SVG_PATH

Example of the NETWORK object entry
```javascript
        id: 137,
        network: "Polygon",
        chain: "MATIC",
        chainId: 137,
        type: "Mainnet",
        rpc:"https://polygon-rpc.com",
        explorer: "https://polygonscan.com/address/",
        color: "#8247e5",
        defaultNFT: "0x5265535c7
```

Show the chain native currency logo
```javascript
import {IPFS_SVG_PATH, NETWORK} from "@idecentralize/erclib";
<Network src={`${IPFS_SVG_PATH}${NETWORK[chainId].chain}.svg`}/>
   
```

```javascript 
const rpc = NETWORK[chainId].rpc
const usdc = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
const decimals = ERC20[chainId][usdc].decimals 
const CToken = ERC20[chainId][usdc].compound
const color = ERC20[chainId][usdc].colors
```

> FORKING :
> network_id should be the chain id return by the provider.
> When forking the mainnet using hardhat, the network id is 31337 and we want to use the mainnet asset under network id 1.


```javascript
ERC20[network_id === 31337 ? 1 : network_id][usdc].decimals  // output decimals of asset
```

# Supported Network
- IPFS
- Ethereum
- Polygon
- BSC
- Aurora
- Avanlance
- xDai

# Supported Testnet & protocols

- Compound 
- Aave 
- Yearn v2 

Please report any issues!

To add some assets, please submit a PR and provide the new IPFS CID.
npm package: @idecentralize/pulsar
Description: Create custom trading strategies without deploying smart contract
Author: Ian Dorion
Latest version: 1.0.1

# PULSAR

Pulsar is a contract that will let you execute custom call on the blockchain and let you make use of the Flasloans in your trading sequences. You do not need to deploy a contract and since we use Polygon the gas to execute such operation is very cheap. 

You can use pulsar for you trading bot as well.

## install

clone this repo and run 

```npm install```.

or directly with npm install

```npm i @idecentralize/pulsar```

Once installed edit and rename your env.example file to .env. Make sure to never share this file.


We have created a demo1 call so you can validate the call.
The call require you to have 1 DAI and 1.5 MATIC

You will make a 1000 DAI loan and repay it back. It will cost you 0,90 DAI in loan fees charge by AAVE an 1 MATIC sent as msg.value that you pay only of you make a successful trade.


Once you have fund your wallet you can run the demo1. You can also make customs calls of you own.
npm package: @idecentralize/simple-server
Description: A simple socket class
Author: Ian Decentralize
Latest version: 1.0.5

# Simple Server
[![Version npm](https://img.shields.io/npm/v/@idecentralize/simple-server.svg?logo=npm)](https://www.npmjs.com/package/@idecentralize/simple-server)

This simple server can;

Listen on HTTP Protocol
Open Socket Connection
Start Arduino Link


## Install

```npm install```



Create an index.js file




> Note to Linux users! You might need to allow permission to access the device.
> Use this command with your device name if different

```sudo chmod a+rw /dev/ttyACM0```
npm package: @idecentralize/simple-socket
Description: A simple socket calss
Author: Ian Decentrlize
Latest version: 1.0.0

# Simple Server

This simple server can;

Listen on HTTP Protocol
Open Socket Connection
Start Arduino Link


## Install

```npm install```



Create an index.js file




> Note to Linux users! You might need to allow permission to access the device.
> Use this command with your device name if different

```sudo chmod a+rw /dev/ttyACM0```
npm package: @ideco/koa-logger
Description: Logging middleware for koa
Author: Christoffer Hallas
Latest version: 3.2.4


# koa-logger

[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]

 Development style logger middleware for [koa](https://github.com/koajs/koa).  Compatible with [request-received](https://github.com/cabinjs/request-received).

___Notice: `koa-logger@2` supports `koa@2`; if you want to use this module with `koa@1`, please use `koa-logger@1`.___

```
<-- GET /
--> GET / 200 835ms 746b
<-- GET /
--> GET / 200 960ms 1.9kb
<-- GET /users
--> GET /users 200 357ms 922b
<-- GET /users?page=2
--> GET /users?page=2 200 466ms 4.66kb
```

## Installation

```js
$ npm install koa-logger
```

## Example

```js
const logger = require('koa-logger')
const Koa = require('koa')

const app = new Koa()
app.use(logger())
```

## Notes

  Recommended that you `.use()` this middleware near the top
  to "wrap" all subsequent middleware.

## Use Custom Transporter

```js
const logger = require('koa-logger')
const Koa = require('koa')

const app = new Koa()
app.use(logger((str, args) => {
  // redirect koa logger to other output pipe
  // default is process.stdout(by console.log function)
}))
```
or
```js
app.use(logger({
  transporter: (str, args) => {
    // ...
  }
}))
```

  Param `str` is output string with ANSI Color, and you can get pure text with other modules like `strip-ansi`  
  Param `args` is a array by `[format, method, url, status, time, length]`

## License

  MIT

[npm-image]: https://img.shields.io/npm/v/koa-logger.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/koa-logger
[travis-image]: https://img.shields.io/travis/koajs/logger.svg?style=flat-square
[travis-url]: https://travis-ci.org/koajs/logger