# test-omg-js

> JavaScript Library to interact with the OMG Network

Latest version **5.0.4-1.0.4** (published 2020-10-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install test-omg-js
pnpm add test-omg-js
yarn add test-omg-js
bun add test-omg-js
```

Provides the command `omgjs-polyfill`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.4-1.0.4 |
| Published | 2020-10-28 |
| First published | 2020-10-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | 12.16.1 |
| Dependencies | 19 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 (+27 in 3 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | OMG Network |
| Maintainers | nicholasmueller |

## Links

- npm: https://www.npmjs.com/package/test-omg-js
- Repository: https://github.com/nicholasmueller/omg-js
- Homepage: https://github.com/nicholasmueller/omg-js#readme
- Issues: https://github.com/nicholasmueller/omg-js/issues
- npm.io page: https://npm.io/package/test-omg-js

## Dependencies (19)

- [rlp](https://npm.io/package/rlp.md) ^2.2.6
- [web3](https://npm.io/package/web3.md) 1.2.2
- [axios](https://npm.io/package/axios.md) ^0.20.0
- [bn.js](https://npm.io/package/bn.js.md) ^5.1.3
- [debug](https://npm.io/package/debug.md) ^4.2.0
- [buffer](https://npm.io/package/buffer.md) ^5.6.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [@hapi/joi](https://npm.io/package/@hapi/joi.md) ^17.1.1
- [web3-utils](https://npm.io/package/web3-utils.md) 1.2.2
- [abi-decoder](https://npm.io/package/abi-decoder.md) ^2.3.0
- [eth-sig-util](https://npm.io/package/eth-sig-util.md) ^2.5.3
- [promise-retry](https://npm.io/package/promise-retry.md) ^2.0.1
- [ethereumjs-abi](https://npm.io/package/ethereumjs-abi.md) ^0.6.8
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) 6.2.0
- [omg-json-bigint](https://npm.io/package/omg-json-bigint.md) ^1.0.0
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^5.0.0
- [web3-eth-contract](https://npm.io/package/web3-eth-contract.md) 1.2.2
- [web3-providers-http](https://npm.io/package/web3-providers-http.md) 1.2.2
- [human-standard-token-abi](https://npm.io/package/human-standard-token-abi.md) ^2.0.0

## Recent versions

- 5.0.4-1.0.4 (latest) — 2020-10-28
- 5.0.3-1.0.4 — 2020-10-28
- 5.0.2-1.0.4 — 2020-10-28
- 5.0.1-1.0.4 — 2020-10-28
- 5.0.0-1.0.4 — 2020-10-28

## README

## OMG-JS 

[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

[![CircleCI](https://circleci.com/gh/omgnetwork/omg-js/tree/master.svg?style=svg)](https://circleci.com/gh/omgnetwork/omg-js/tree/master)

This is a Javascript/Typescript library that allows you to interact with OMG Network's MoreVP implementation of Plasma. It provides functions to:

1. Deposit (Eth/ERC20) from the Rootchain into the Childchain.
2. Transact on the Childchain.
3. Exit from the Childchain back to the Rootchain.
4. Challenge invalid exits.

## Compatibility

`omg-js` follows a modified semver with the first part referring to its own library versioning and the second part referring to its compatible [`elixir-omg`](https://github.com/omgnetwork/elixir-omg/releases) version.

```
ie. v1.0.3-2.0.1

1.0.3 -> omg-js version
2.0.1 -> compatible elixir-omg version
```

## Installation

#### Node
Requires Node >= 8.11.3 < 13.0.0
```
npm install @omisego/omg-js
```

#### Browser
You can add `omg-js` to a website quickly. Just add this script tag.
```
<script src="https://unpkg.com/@omisego/browser-omg-js"></script>
```

#### React Native
`omg-js` can easily be integrated with React Native projects. Only some Node specific modules will need to be pollyfilled using the process below.

First install `rn-nodeify` to your project
```
npm install rn-nodeify
```

Then, add this postinstall script to your project's `package.json`
```
"scripts": {
    "postinstall": "omgjs-polyfill"
}
```

Then install the omg-js library
```
npm install @omisego/omg-js
```

## Usage

1. Instantiate an omgjs instance passing configuration values and a Web3 provider.
```js
import Web3 from 'web3';
import OmgJS from '@omisego/omg-js';

const web3Provider = new Web3.providers.HttpProvider(eth_node);
const omgjs = new OmgJS({
  plasmaContractAddress: plasmaframework_contract_address,
  watcherUrl: watcher_url,
  web3Provider
});
```

2. Call a method on the instance. If you're using Typescript, you can access any of the library interfaces.
```js
import { ITransactionReceipt } from '@omisego/omg-js';

const depositResult: ITransactionReceipt = await omgjs.deposit({
  amount: 1,
  txOptions: { from, privateKey }
});

console.log(`Deposit success! ${depositResult.transactionHash}`);
```

3. Check out the [documentation](https://docs.omg.network/omg-js/) or [examples](./examples) for more information.

## Documentation

[Documentation for omg-js ](https://docs.omg.network/omg-js/)

## Examples

You can find examples on common library methods and instructions on how to run them in the [`/examples`](./examples) folder.

## Integration Tests

You can find instructions on running the integrations tests in the [`/integration-tests`](./integration-tests) folder.

---
_Source: https://npm.io/package/test-omg-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
