Created
April 14, 2019 13:01
-
-
Save buddies2705/2203c50bf59ff1210efd007b86dea5c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch(started()); | |
const maker = Maker.create(process.env.REACT_APP_NETWORK, { | |
privateKey: process.env.REACT_APP_PRIVATE_KEY, | |
overrideMetamask: true, | |
provider: { | |
infuraProjectId | |
} | |
}); | |
console.log('maker:', maker); | |
dispatch(makerCreated()); | |
const cdp = await maker.openCdp(); | |
console.log('cdp:', cdp); | |
dispatch(cdpOpened()); | |
const lockEthTx = await cdp.lockEth(0.01); | |
console.log('transaction to lock eth:', lockEthTx); | |
dispatch(ethLocked()); | |
await dispatch(drawDaiAsync(maker, cdp)); | |
await dispatch(wipeDebtAsync(maker, cdp)); | |
await dispatch(shutCdpAsync(cdp)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment