# switcheo-node-api

Latest version **1.0.0** (published 2019-10-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install switcheo-node-api
pnpm add switcheo-node-api
yarn add switcheo-node-api
bun add switcheo-node-api
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-10-04 |
| First published | 2019-10-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 24 |
| Unpacked size | 14.5 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | johnwong_switcheo |

## Links

- npm: https://www.npmjs.com/package/switcheo-node-api
- npm.io page: https://npm.io/package/switcheo-node-api

## Dependencies (24)

- [web3](https://npm.io/package/web3.md) ^1.2.1
- [bn.js](https://npm.io/package/bn.js.md) ^5.0.0
- [humps](https://npm.io/package/humps.md) ^2.0.1
- [redis](https://npm.io/package/redis.md) ^2.8.0
- [yargs](https://npm.io/package/yargs.md) ^11.0.0
- [eth-lib](https://npm.io/package/eth-lib.md) ^0.2.8
- [express](https://npm.io/package/express.md) ^4.16.3
- [winston](https://npm.io/package/winston.md) ^2.4.4
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.5
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.1.2
- [eth-crypto](https://npm.io/package/eth-crypto.md) ^1.4.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.2.1
- [redis-lock](https://npm.io/package/redis-lock.md) ^0.1.4
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.3.3
- [abi-decoder](https://npm.io/package/abi-decoder.md) ^2.2.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.18.3
- [@sentry/node](https://npm.io/package/@sentry/node.md) ^4.0.6
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.0
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.0.0
- [express-winston](https://npm.io/package/express-winston.md) ^2.5.1
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.3.1
- [web3-core-helpers](https://npm.io/package/web3-core-helpers.md) ^1.2.1
- [winston-raven-sentry](https://npm.io/package/winston-raven-sentry.md) ^2.0.0
- [truffle-privatekey-provider](https://npm.io/package/truffle-privatekey-provider.md) ^0.1.0

## Recent versions

- 1.0.0 (latest) — 2019-10-04

## README

# ETH Broadcaster


## Dependencies

Requires the contracts from [switcheo-eth](https://github.com/ConjurTech/switcheo-eth) to be deployed on your local Ganache application.

Use the following mnemonic for Ganache to ensure your deployed contracts matches the contract address in `lib/artifacts/Broker.json`. In Ganache, Settings > ACCOUNTS & KEYS, enter:

```fly fee spell coin can security input already ozone swallow juice limit```

## Running

To connect to ganache, run:
```
$ npm run watch-dev
```

## Deploying

The `./env.json` file needs to be setup:
```
{
  "SWITCHEO_ENV": "<canary|staging|production>",
  "SENTRY_DSN": "<sentry-reporting-url>",
  "REDIS_URL": "<redis-host-url>",
  "COORDINATOR_KEY": "<coordinator-private-key>",
  "SWAP_PROVIDER_KEY": <swap-provider-private-key>",
  "INFURA_ID": "<infura-id>",
  "CHAIN_ID": "<chain-id>",
  "ADMIN_KEYS": {
    "<admin-address-1>": "<admin-private-key-1>",
    "<admin-address-2>": "<admin-private-key-2>"
  }
}
```

To deploy, pull in the latest commit, build, and run with `pm2`:
```
$ git pull
$ npm i && npm run build
$ pm2 delete 0 # if already running
$ pm2 start ./dist/index.js
```

For subsequent deploys, and if the arguments to the app does not need to be changed, then you can also deploy the code with: `. deploy.sh`.

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