{"id":36540483,"url":"https://github.com/omgnetwork/omg-js","last_synced_at":"2026-01-12T05:45:32.686Z","repository":{"id":39703995,"uuid":"148651051","full_name":"omgnetwork/omg-js","owner":"omgnetwork","description":"JavaScript Library for communication with OMG network","archived":false,"fork":false,"pushed_at":"2023-04-29T09:21:45.000Z","size":13936,"stargazers_count":43,"open_issues_count":79,"forks_count":15,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-11-02T11:13:48.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omgnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-13T14:33:43.000Z","updated_at":"2025-06-10T03:01:31.000Z","dependencies_parsed_at":"2024-06-18T16:49:22.303Z","dependency_job_id":"9cbb21c2-a571-4a2f-84e8-3420349decc1","html_url":"https://github.com/omgnetwork/omg-js","commit_stats":null,"previous_names":["omisego/omg-js"],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/omgnetwork/omg-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fomg-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fomg-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fomg-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fomg-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omgnetwork","download_url":"https://codeload.github.com/omgnetwork/omg-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fomg-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T05:45:31.546Z","updated_at":"2026-01-12T05:45:32.680Z","avatar_url":"https://github.com/omgnetwork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## OMG-JS \n\n[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n[![CircleCI](https://circleci.com/gh/omgnetwork/omg-js/tree/master.svg?style=svg)](https://circleci.com/gh/omgnetwork/omg-js/tree/master)\n\nThis is a Javascript library that allows you to interact with OmiseGo's MoreVP implementation of Plasma. It provides functions to:\n\n1. Deposit (Eth/Token) from the Root chain into the Child chain.\n2. Transact on the Child chain.\n3. Exit from the Child chain back to the Root chain.\n4. Challenge an invalid exit.\n\n## Compatibility\n\n`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` version.\n\n## Getting Started\n\nThe project is organized into 3 submodules:\n\n1. @omisego/omg-js-rootchain\n2. @omisego/omg-js-childchain\n3. @omisego/omg-js-util\n\nYou can use any of them separately, or all at once by importing the parent `@omisego/omg-js` package.\n\n## Installation\n\n#### Node\nRequires Node \u003e= 8.11.3 \u003c 13.0.0\n```\nnpm install @omisego/omg-js\n```\n\n#### Browser\nYou can add `omg-js` to a website quickly. Just add this script tag.\n```\n\u003cscript src=\"https://unpkg.com/@omisego/browser-omg-js\"\u003e\u003c/script\u003e\n```\n\n#### React Native\n`omg-js` can easily be integrated with React Native projects.\nFirst, add this postinstall script to your project's `package.json`\n```\n\"scripts\": {\n    \"postinstall\": \"omgjs-nodeify\"\n}\n```\n\nThen install the react native compatible library.\n```\nnpm install @omisego/react-native-omg-js\n```\n\n## API Documentation\n\n[Documentation for omg-js ](https://docs.omg.network/omg-js/)\n\n## Design Documentation\n\n[Sending a transaction](/integration-docs/transactions.md)  \n[How to sign a transaction](/integration-docs/signing-methods.md)\n\n## Examples\n\n#### Prerequisites\n\nBoth Alice's and Bob's Ethereum accounts need to have some ETH in them. The ETH is used for gas costs on the rootchain, fees on the childchain and the actual ETH transferred from Alice to Bob.\nIf you want to run the ERC20 examples, make sure the token address is recorded in your `.env` and either Alice or Bob has a balance on the rootchain.\n\n#### Running the Examples\n\nYou can find example code inside the `examples` folder. \n\nTo run the examples:\n- `npm install` from root of `omg-js`.\n- Step inside the `/examples` directory.\n- Run `npm install`.\n- Create `.env` file inside the root of the `/examples` directory with the appropriate values (see `/examples/env.example` for an example)\n\n- Refer to below explanation of `.env` variables\n```\nETH_NODE=                           \u003centry point to an ethereum node\u003e\nWATCHER_URL=                        \u003curl of an informational watcher\u003e\nWATCHER_PROXY_URL=                  \u003c*optional* proxy server to catch all watcher requests\u003e\nPLASMAFRAMEWORK_CONTRACT_ADDRESS=   \u003caddress of the plasma_framework contract\u003e\nERC20_CONTRACT_ADDRESS=             \u003c*optional* address of the erc20 contract that Alice will deposit and transfer to Bob\u003e\nALICE_ETH_ADDRESS=                  \u003caddress of Alice's account\u003e\nALICE_ETH_ADDRESS_PRIVATE_KEY=      \u003cAlice's private key\u003e\nBOB_ETH_ADDRESS=                    \u003caddress of Bob's account\u003e\nBOB_ETH_ADDRESS_PRIVATE_KEY=        \u003cBob's private key\u003e\nMILLIS_TO_WAIT_FOR_NEXT_BLOCK=      \u003cinterval when checking for block confirmation\u003e\nBLOCKS_TO_WAIT_FOR_TXN=             \u003camount of blocks to wait for confirmation\u003e\n```\n\nLet's run through a story between Alice and Bob. In this story, Alice will first deposit some ETH from the root chain into the child chain. Then Alice will transfer some of that ETH to Bob on the child chain. Bob will then exit his funds from the child chain back into the root chain. His root chain balance will be reflected with the extra ETH that Alice sent to him on the child chain.\n\n*_Note_* you can modify the values of the passed flags to suit your needs\n\n#### Helpful Scripts\n\nFrom the `/examples` folder run the following scripts:\n\n- [Get Alice's and Bob's balances](examples/print-balance.js)\n\n    `node print-balance --owner=alice`  \n    `node print-balance --owner=bob`\n\n- [Get Alice's and Bob's Childchain UTXOs](examples/print-utxos.js)\n\n    `node print-utxos --owner=alice`  \n    `node print-utxos --owner=bob`\n\n#### ETH Examples\n\n1. [Deposit some ETH from Alice's Rootchain to the Childchain](examples/deposit-eth.js)\n    \n    `node deposit-eth --owner=alice --amount=0.01`\n\n2. [Send some ETH from Alice's Childchain to Bob's Childchain](examples/transaction-eth.js)\n    \n    `node transaction-eth --from=alice --to=bob --amount=0.001`\n\nAlice has now sent some ETH to Bob. This should be reflected in Bob's childchain balance.\n\n3. [Exit one of Bob's Childchain UTXOs to the Rootchain](examples/exit-eth.js)\n\n    `node exit-eth --owner=bob`\n\nChecking Bob's final rootchain balance you will notice it will be a little less than expected. This is because of rootchain gas costs Bob had to pay to exit the childchain.\n\n4. [Bob starts and piggyback's an inflight exit for his ouput on a transaction sent by Alice](example/inflight-exit-eth.js)\n\n    `node inflight-exit-eth --from=alice --to=bob --amount=0.01`\n\n#### ERC20 Examples\n\nBefore we begin, we need to deploy and mint some ERC20 tokens.\nFrom the examples folder run the following command:\n\n```\nnpm run deploy-test-erc20 --prefix ../packages/integration-tests\n```\n\nUse the ERC20 contract address from the output above to configure `ERC20_CONTRACT_ADDRESS` in your `.env` file.\n\nNow let's run through the same story above but for ERC20 deposit/transaction/exit.\n\n1. [Deposit some ERC20 from Alice's Rootchain to the Childchain](examples/deposit-erc20.js)\n    \n    `node deposit-erc20 --owner=alice --amount=10`\n\n2. [Send some ERC20 from Alice's Childchain to Bob's Childchain](examples/transaction-erc20.js)\n    \n    `node transaction-erc20 --from=alice --to=bob --amount=1`\n\n3. [Exit one of Bob's Childchain ERC20 UTXOs to the Rootchain](examples/exit-erc20.js)\n\n    `node exit-erc20 --owner=bob`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomgnetwork%2Fomg-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomgnetwork%2Fomg-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomgnetwork%2Fomg-js/lists"}