Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dai-plugin-maker-otc
Advanced tools
A dai.js plugin for interacting with the maker OTC contract
First, install:
$ yarn add @makerdao/dai-plugin-maker-otc
Then add it to your configuration:
import Maker from '@makerdao/dai';
import MakerOtc from '@makerdao/dai-plugin-eth2dai-direct';
async function createMakerInstance(amount) {
const maker = await Maker.create('browser', {
plugins: [MakerOtc]
});
await maker.authenticate();
await maker.service('exchange').sell('ETH', 'DAI', amount);
}
const exchange = maker.service('exchange');
Sell a set amount of DAI and receive another token in return.
Parameters
daiAmount
- Amount of DAI to sell.tokenSymbol
- Token to receive in return.minFillAmount
- Minimum amount to receive in return.Returns: promise (resolves to OasisOrder once mined)
// Sell 100.00 DAI for 0.30 WETH or more.
const sellOrder = await exchange.sellDai('100.0', 'WETH', '0.30');
Buy a set amount of DAI and give another token in return.
Parameters
daiAmount
- Amount of DAI to buy.tokenSymbol
- Token to give in return.minFillAmount
- Maximum amount to give in return.Returns: promise (resolves to OasisOrder once mined)
// Buy 100.00 DAI for 0.30 WETH or less.
const buyOrder = await exchange.buyDai('100.0', 'WETH', '0.35');
OasisOrders
have a few methods: fillAmount
: amount of token received in exchange fees()
: amount of ether spent on gas created()
: timestamp of when transaction was mined
const buyOrder = await exchange.buyDai('100.0', 'WETH', '0.35');
const fillAmount = buyOrder.fillAmount();
const gasPaid = buyOrder.fees();
const created = buyOrder.created();
FAQs
A dai.js plugin for interacting with the maker OTC contract
The npm package dai-plugin-maker-otc receives a total of 0 weekly downloads. As such, dai-plugin-maker-otc popularity was classified as not popular.
We found that dai-plugin-maker-otc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.