Skip to content

Gateway between Front App and the detherContracts.

Notifications You must be signed in to change notification settings

dethertech/dether.js

Repository files navigation

DetherJS

DetherJS is Javascript SDK to easily interact with DetherContracts

It provides wrappers for all the public methods of the contract and formats values in and out. All infos about ETH/Tokens buyers/sellers are stored inside the smart contracts and easily accessible with this library. You can as well easily modify as well the states of the dether smart contract. This library interact with the current version of DetherContracts deployed on:
Mainnet

Table of Contents

Install

Use NPM to get the package

npm install --save detherjs

yarn add detherjs

Docs

Extensive documentation of the principal methods can be found on the API documentation

Usage

You can find more examples of method usage in examples/

Test

There are two types of tests, tests that use stubs/mocks, and tests that first deploy all contracts on a given chain and then execute using the deployed contracts instead of stubs/mocks.

Stub/mock tests

yarn test

Onchain tests

There are spec files ending in .onchain.js. These files will deploy the Dether contracts on a given chain and run the tests inside the .onchain.js file. To set this up create a copy of test/.env.sample and name it .env. Update values accordingly.

Example: local with ganache-cli

  1. start up ganache and copy one of the private keys generated
  2. set the test/.env file content to
RPC_URL=http://localhost:8545/
DEPLOY_PRIVKEY=<private key from step 1, prefixed with 0x>
  1. run npm run test-onchain

Example: kovan

  1. copy the private key of the account (which has sufficient ETH) that you want to use to deploy on the kovan network
  2. set the .env file content to
NETWORK=kovan
DEPLOY_PRIVKEY=<private key from step 1, prefixed with 0x>
  1. now run npm run test-onchain

Example

yarn run example1

Dependencies

Bugs

When you find issues, please report them:

Donation

TODO

  • Add more example: with geocoding API, certify API

About

Gateway between Front App and the detherContracts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published