Single-Collateral Sai
Last updated
Last updated
Single-Collateral Dai support in Dai.js is implemented as a . The SCD plugin is also available as an package and its source code can be found on .
npm install @makerdao/dai-plugin-scd
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.
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.
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 to read its state and perform actions.