├── .ebextensions └── disable-npm.config ├── .gitignore ├── README.md ├── build ├── arrow_down.svg ├── asset-manifest.json ├── checkmark.svg ├── favicon.ico ├── index.html ├── logo.svg ├── manifest.json ├── service-worker.js └── static │ ├── css │ ├── main.e9241897.css │ └── main.e9241897.css.map │ └── js │ ├── main.95f7d3fb.js │ └── main.95f7d3fb.js.map ├── buildspec.yml ├── package.json ├── public ├── arrow_down.svg ├── cDAI_screenshot.png ├── checkmark.svg ├── favicon.ico ├── index.html ├── logo.svg └── manifest.json └── src ├── app.js ├── components ├── amount.js ├── button.js ├── footer.js ├── info.js ├── payment.js ├── status.js ├── token.js └── totals.js ├── css └── footer.css ├── index.css ├── index.js └── utility.js /.ebextensions/disable-npm.config: -------------------------------------------------------------------------------- 1 | # This file is controlled by the `eb-disable-npm` Node module. If you'd like to 2 | # modify it, you either should publish a new version of that module and update 3 | # to that version; or, you should uninstall that module and then edit this file 4 | # --uninstallation won't take the file with it. 5 | 6 | # This file prevents Elastic Beanstalk from trying to run `npm install` or 7 | # `npm rebuild` on its EC2 instances. See the README for why. 8 | 9 | files: 10 | "/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh": 11 | mode: "000755" 12 | owner: root 13 | group: users 14 | content: | 15 | #!/usr/bin/env bash 16 | # 17 | # Prevent installing or rebuilding like Elastic Beanstalk tries to do by 18 | # default. 19 | # 20 | # Note that this *overwrites* Elastic Beanstalk's default 50npm.sh script 21 | # (https://gist.github.com/wearhere/de51bb799f5099cec0ed28b9d0eb3663). 22 | 23 | "/opt/elasticbeanstalk/hooks/configdeploy/pre/50npm.sh": 24 | mode: "000755" 25 | owner: root 26 | group: users 27 | content: | 28 | #!/usr/bin/env bash 29 | # 30 | # Prevent installing or rebuilding like Elastic Beanstalk tries to do by 31 | # default. 32 | # 33 | # Note that this *overwrites* Elastic Beanstalk's default 50npm.sh script. 34 | # But their default script actually doesn't work at all, since the app 35 | # staging dir, where they try to run `npm install`, doesn't exist during 36 | # config deploys, so ebnode.py just aborts: 37 | # https://gist.github.com/wearhere/de51bb799f5099cec0ed28b9d0eb3663#file-ebnode-py-L140 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .git 2 | node_modules 3 | package-lock.json 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Documentation 2 | See the [DEXAG Docs](https://docs.dex.ag) 3 | View the app running live [cDAI.io](https://cdai.io) 4 | 5 | ## Installation 6 | Install the packages with: 7 | ``` 8 | npm install 9 | ``` 10 | 11 | ## Start the app 12 | ``` 13 | npm run start 14 | ``` 15 | 16 | ## Main SDK Usage 17 | Query DEXes for the best price and execute the trade with a web3 browser. 18 | ``` 19 | import {DEXAG} from 'dexag-sdk' 20 | const sdk = DEXAG.fromProvider(window.ethereum) 21 | 22 | // receive status messages as the client executes the trade 23 | sdk.registerStatusHandler((status, data)=>{ 24 | console.log(status, data) 25 | }); 26 | 27 | // get trade 28 | const trade = await sdk.getTrade({to: 'DAI', from: 'ETH', toAmount: 1}) 29 | 30 | // checkout 31 | const valid = await sdk.validate(trade); 32 | if (valid) { 33 | // web3 is valid, trade order 34 | sdk.trade({tx: trade}); /** Metamask opens **/ 35 | } 36 | ``` 37 | 38 | ## More information 39 | Find more information about how to build DEX trading into your platform on the [DEXAG Docs](https://docs.dex.ag) 40 | -------------------------------------------------------------------------------- /build/arrow_down.svg: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "main.css": "static/css/main.e9241897.css", 3 | "main.css.map": "static/css/main.e9241897.css.map", 4 | "main.js": "static/js/main.95f7d3fb.js", 5 | "main.js.map": "static/js/main.95f7d3fb.js.map" 6 | } -------------------------------------------------------------------------------- /build/checkmark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SettleFinance/cDAI/292fd0f7ab454611678e277bd457ccfc07a37fb2/build/favicon.ico -------------------------------------------------------------------------------- /build/index.html: -------------------------------------------------------------------------------- 1 |
{type=='buy'?'pay':'receive'}:
22 |for:
27 |