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
Use NPM to get the package
npm install --save detherjs
yarn add detherjs
Extensive documentation of the principal methods can be found on the API documentation
You can find more examples of method usage in examples/
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.
yarn test
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.
- start up ganache and copy one of the private keys generated
- set the
test/.env
file content to
RPC_URL=http://localhost:8545/
DEPLOY_PRIVKEY=<private key from step 1, prefixed with 0x>
- run
npm run test-onchain
- copy the private key of the account (which has sufficient ETH) that you want to use to deploy on the kovan network
- set the
.env
file content to
NETWORK=kovan
DEPLOY_PRIVKEY=<private key from step 1, prefixed with 0x>
- now run
npm run test-onchain
yarn run example1
When you find issues, please report them:
- Add more example: with geocoding API, certify API