Single-Collateral Sai
Installation
Single-Collateral Dai support in Dai.js is implemented as a plugin. The SCD plugin is also available as an npm package and its source code can be found on Github.
npm install @makerdao/dai-plugin-scd
Quick example
The code below creates a CDP, locks ETH into it, and draws out Sai.
The services and objects below are used to work with Single-Collateral Sai.
openCdp()
Returns: promise (resolves to new CDP object once mined)
openCdp()
will create a new CDP, and then return the CDP object, which can be used to access other CDP functionality. The promise will resolve when the transaction is mined.
getCdp(int id)
Returns: promise (resolves to CDP object)
getCdp(id)
creates a CDP object for an existing CDP. The CDP object can then be used to interact with your CDP.
Once you have an instance of a CDP, you can use CDP instance methods to read its state and perform actions.
Last updated