Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Commit

Permalink
Add image to README
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Jul 17, 2018
1 parent 576d91b commit 97458a9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<img width="350px" src="http://dutchx.readthedocs.io/en/latest/_static/DutchX-logo_blue.svg" />
</p>

# DutchX Documentation
The Dutch Exchange (DutchX) is a fully decentralized exchange, which allows
**everyone** to add any trading token pair.
Expand Down
36 changes: 36 additions & 0 deletions source/TODO_build_an_app_using_dx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Get started - Use DX in your project
Add it to your project:

```bash
# Install the dependencies
yarn add truffle-contract @gnosis.pm/dx-contracts --save # or npm install @gnosis.pm/dx-contracts --save
```

You will find the compiled truffle contracts in the `build/contracts` folder,
these contract abstractions will also contain the addresses for the DX for
**mainnet** and the **testnets**.

For example:
```js
const contract = require('truffle-contract')

// Create the truffle contracts
const DutchExchangeProxy = contract(require('@gnosis.pm/dx-contracts/build/contracts/DutchExchangeProxy'))
const DutchExchange = contract(require('@gnosis.pm/dx-contracts/build/contracts/DutchExchange'))

// Setup your provider
// provider = ...
DutchExchange.setProvider(provider)
DutchExchangeProxy.setProvider(provider)

// Get the contract instance
DutchExchangeProxy.deployed(async proxy => {
const dx = DutchExchange.at(proxy.address)

// Use any of the dx methods
const token1 = '0x123456'
const token1 = '0x654321'
const auctionIndex = await dx.getAuctionIndex.call(token1, token2)
console.log(auctionIndex)
})
```

0 comments on commit 97458a9

Please sign in to comment.